Reset scrollLeft when setSoftWrapColumn is called

When the scroll view is scrolled and overflow-x is set to 
'hidden' the scroll view renders wrong. Setting scrollLeft to 0 fixes
this problem. I'm unhappy with this solution, but it was a
simple way to get the scroll view to update its layout.

Closes #137
This commit is contained in:
probablycorey
2013-03-27 15:07:30 -07:00
parent a48a52922b
commit fd7772a653
2 changed files with 10 additions and 0 deletions

View File

@@ -590,6 +590,7 @@ class Editor extends View
@setSoftWrapColumn(softWrapColumn) if @attached
if @activeEditSession.getSoftWrap()
@addClass 'soft-wrap'
@scrollView.scrollLeft(0)
@_setSoftWrapColumn = => @setSoftWrapColumn()
$(window).on "resize.editor-#{@id}", @_setSoftWrapColumn
else