mirror of
https://github.com/atom/atom.git
synced 2026-04-06 03:02:13 -04:00
Update presenter scrollHeight when clientHeight changes
Signed-off-by: Nathan Sobo <nathan@github.com>
This commit is contained in:
committed by
Nathan Sobo
parent
33081cefda
commit
f218e985cf
@@ -51,6 +51,11 @@ describe "TextEditorPresenter", ->
|
||||
expectStateUpdate presenter, -> editor.getBuffer().append("\n\n\n")
|
||||
expect(presenter.state.scrollHeight).toBe editor.getScreenLineCount() * 10
|
||||
|
||||
it "updates when ::clientHeight changes", ->
|
||||
presenter = new TextEditorPresenter(model: editor, scrollTop: 0, lineHeight: 10)
|
||||
expectStateUpdate presenter, -> presenter.setClientHeight(500)
|
||||
expect(presenter.state.scrollHeight).toBe 500
|
||||
|
||||
describe ".scrollTop", ->
|
||||
it "tracks the value of ::scrollTop", ->
|
||||
presenter = new TextEditorPresenter(model: editor, scrollTop: 10, lineHeight: 10)
|
||||
|
||||
@@ -295,6 +295,7 @@ class TextEditorPresenter
|
||||
getScrollLeft: -> @scrollLeft
|
||||
|
||||
setClientHeight: (@clientHeight) ->
|
||||
@updateVerticalScrollState()
|
||||
@updateLinesState()
|
||||
@updateCursorsState()
|
||||
@updateHighlightsState()
|
||||
|
||||
Reference in New Issue
Block a user