use offset instead of position

This commit is contained in:
Justin Palmer
2013-02-13 15:36:39 -08:00
parent fdd57d5e64
commit 936324a75f

View File

@@ -121,8 +121,8 @@ class PreviewList extends ScrollView
@operations[@selectedOperationIndex]
scrollToElement: (element) ->
top = @scrollTop() + element.position().top
bottom = top + element.outerHeight()
top = @scrollTop() + element.offset().top
bottom = top - element.outerHeight()
if bottom > @scrollBottom()
@scrollBottom(bottom)