💚 Fix TextEditorComponent specs

This commit is contained in:
Antonio Scandurra
2015-09-22 18:45:38 +02:00
parent e3dabd5200
commit ddd7aacd9d
4 changed files with 92 additions and 44 deletions

View File

@@ -358,6 +358,30 @@ class TextEditorComponent
@scrollViewNode.scrollTop = 0
@scrollViewNode.scrollLeft = 0
setScrollLeft: (scrollLeft) ->
@presenter.setScrollLeft(scrollLeft)
setScrollRight: (scrollRight) ->
@presenter.setScrollRight(scrollRight)
setScrollTop: (scrollTop) ->
@presenter.setScrollTop(scrollTop)
setScrollBottom: (scrollBottom) ->
@presenter.setScrollBottom(scrollBottom)
getScrollTop: ->
@presenter.getScrollTop()
getScrollLeft: ->
@presenter.getScrollLeft()
getScrollRight: ->
@presenter.getScrollRight()
getScrollBottom: ->
@presenter.getScrollBottom()
onMouseDown: (event) =>
unless event.button is 0 or (event.button is 1 and process.platform is 'linux')
# Only handle mouse down events for left mouse button on all platforms

View File

@@ -219,6 +219,30 @@ class TextEditorElement extends HTMLElement
onDidDetach: (callback) ->
@emitter.on("did-detach", callback)
setScrollLeft: (scrollLeft) ->
@component.setScrollLeft(scrollLeft)
setScrollRight: (scrollRight) ->
@component.setScrollRight(scrollRight)
setScrollTop: (scrollTop) ->
@component.setScrollTop(scrollTop)
setScrollBottom: (scrollBottom) ->
@component.setScrollBottom(scrollBottom)
getScrollTop: ->
@component.getScrollTop()
getScrollLeft: ->
@component.getScrollLeft()
getScrollRight: ->
@component.getScrollRight()
getScrollBottom: ->
@component.getScrollBottom()
stopEventPropagation = (commandListeners) ->
newCommandListeners = {}
for commandName, commandListener of commandListeners