mirror of
https://github.com/pulsar-edit/pulsar.git
synced 2024-11-14 04:29:04 +03:00
Add a drop shadow to gutter when horizontal scroller is scrolled right.
This commit is contained in:
parent
5709b0d152
commit
7d2d0f2037
@ -161,6 +161,21 @@ describe "Editor", ->
|
||||
editor.createFold([[3, 10], [5, 1]])
|
||||
expect(editor.gutter.find('.line-number:eq(3)').text()).toBe '4'
|
||||
expect(editor.gutter.find('.line-number:eq(4)').text()).toBe '7'
|
||||
it "adds a drop shadow when the horizontal scroller is scrolled to the right", ->
|
||||
editor.attachToDom()
|
||||
editor.width(100)
|
||||
|
||||
expect(editor.gutter).not.toHaveClass('drop-shadow')
|
||||
|
||||
editor.horizontalScroller.scrollLeft(10)
|
||||
editor.horizontalScroller.trigger('scroll')
|
||||
|
||||
expect(editor.gutter).toHaveClass('drop-shadow')
|
||||
|
||||
editor.horizontalScroller.scrollLeft(0)
|
||||
editor.horizontalScroller.trigger('scroll')
|
||||
|
||||
expect(editor.gutter).not.toHaveClass('drop-shadow')
|
||||
|
||||
describe "cursor movement", ->
|
||||
describe ".setCursorScreenPosition({row, column})", ->
|
||||
|
@ -127,6 +127,12 @@ class Editor extends View
|
||||
position.left = Math.min(position.left, @horizontalScroller.width() - @charWidth)
|
||||
@hiddenInput.css(position)
|
||||
|
||||
@horizontalScroller.on 'scroll', =>
|
||||
if @horizontalScroller.scrollLeft() == 0
|
||||
@gutter.removeClass('drop-shadow')
|
||||
else
|
||||
@gutter.addClass('drop-shadow')
|
||||
|
||||
@one 'attach', =>
|
||||
@calculateDimensions()
|
||||
@hiddenInput.width(@charWidth)
|
||||
|
Loading…
Reference in New Issue
Block a user