Subtract preview list offset from top

This commit is contained in:
Kevin Sawicki
2013-02-13 16:51:47 -08:00
parent 107d1e2c93
commit d7b6b282a5

View File

@@ -123,9 +123,7 @@ class PreviewList extends ScrollView
@operations[@selectedOperationIndex]
scrollToElement: (element) ->
top = @scrollTop() +
element.position().top +
element.closest('li.path').position().top
top = @scrollTop() + element.offset().top - @offset().top
bottom = top + element.outerHeight()
@scrollBottom(bottom) if bottom > @scrollBottom()