WIP: Don't allow impossibly high scroll top values.

It fixes the move to bottom issues, but breaks some other tests. Not sure why yet...
This commit is contained in:
Nathan Sobo
2012-06-04 21:57:10 -06:00
parent 3c2facc7be
commit 9cfbce826d
2 changed files with 7 additions and 4 deletions

View File

@@ -273,7 +273,9 @@ class Editor extends View
scrollTop: (scrollTop, options) ->
return @cachedScrollTop or 0 unless scrollTop?
scrollTop = Math.max(0, scrollTop)
maxScrollTop = @scrollView.prop('scrollHeight') - @scrollView.height()
scrollTop = Math.floor(Math.min(maxScrollTop, Math.max(0, scrollTop)))
return if scrollTop == @cachedScrollTop
@cachedScrollTop = scrollTop