Show selection at the top of the sidebar on reset/reveal

pull/67/merge
Thibaut 11 years ago
parent 5b6d9d983b
commit 2327397876

@ -173,7 +173,7 @@ $.scrollTo = (el, parent, position = 'center', options = {}) ->
switch position switch position
when 'top' when 'top'
parent.scrollTop = top - (options.margin or 20) parent.scrollTop = top - (if options.margin? then options.margin else 20)
when 'center' when 'center'
parent.scrollTop = top - Math.round(parentHeight / 2 - el.offsetHeight / 2) parent.scrollTop = top - Math.round(parentHeight / 2 - el.offsetHeight / 2)
when 'continuous' when 'continuous'

@ -91,7 +91,7 @@ class app.views.DocList extends app.View
return return
scrollTo: (model) -> scrollTo: (model) ->
$.scrollTo @find("a[href='#{model.fullPath()}']") $.scrollTo @find("a[href='#{model.fullPath()}']"), null, 'top', margin: 0
return return
afterRoute: (route, context) => afterRoute: (route, context) =>

Loading…
Cancel
Save