mirror of
https://github.com/atom/atom.git
synced 2026-04-06 03:02:13 -04:00
fix preview list automatic scrolling
This commit is contained in:
@@ -123,13 +123,13 @@ class PreviewList extends ScrollView
|
||||
@operations[@selectedOperationIndex]
|
||||
|
||||
scrollToElement: (element) ->
|
||||
top = @scrollTop() + element.offset().top
|
||||
bottom = top - element.outerHeight()
|
||||
top = @scrollTop() +
|
||||
element.position().top +
|
||||
element.closest('li.path').position().top
|
||||
bottom = top + element.outerHeight()
|
||||
|
||||
if bottom > @scrollBottom()
|
||||
@scrollBottom(bottom)
|
||||
if top < @scrollTop()
|
||||
@scrollTop(top)
|
||||
@scrollBottom(bottom) if bottom > @scrollBottom()
|
||||
@scrollTop(top) if top < @scrollTop()
|
||||
|
||||
scrollToBottom: ->
|
||||
super()
|
||||
|
||||
Reference in New Issue
Block a user