Add .focused to presenter state

Signed-off-by: Max Brunsfeld <maxbrunsfeld@gmail.com>
This commit is contained in:
Nathan Sobo
2015-02-12 17:48:28 -07:00
parent 5c7e0c387a
commit 4654bad543
2 changed files with 15 additions and 1 deletions

View File

@@ -14,7 +14,7 @@ class TextEditorPresenter
{@model, @autoHeight, @explicitHeight, @contentFrameWidth, @scrollTop, @scrollLeft} = params
{horizontalScrollbarHeight, verticalScrollbarWidth} = params
{@lineHeight, @baseCharacterWidth, @lineOverdrawMargin, @backgroundColor, @gutterBackgroundColor} = params
{@cursorBlinkPeriod, @cursorBlinkResumeDelay, @stoppedScrollingDelay} = params
{@cursorBlinkPeriod, @cursorBlinkResumeDelay, @stoppedScrollingDelay, @focused} = params
@measuredHorizontalScrollbarHeight = horizontalScrollbarHeight
@measuredVerticalScrollbarWidth = verticalScrollbarWidth
@@ -103,6 +103,7 @@ class TextEditorPresenter
@updateStartRow()
@updateEndRow()
@updateFocusedState()
@updateHeightState()
@updateVerticalScrollState()
@updateHorizontalScrollState()
@@ -116,6 +117,9 @@ class TextEditorPresenter
@updateGutterState()
@updateLineNumbersState()
updateFocusedState: ->
@state.focused = @focused
updateHeightState: ->
if @autoHeight
@state.height = @contentHeight
@@ -472,6 +476,7 @@ class TextEditorPresenter
setFocused: (focused) ->
unless @focused is focused
@focused = focused
@updateFocusedState()
@updateHiddenInputState()
setScrollTop: (scrollTop) ->