After an index refresh, only scroll down if needed.
This commit is contained in:
parent
f0d19e6a5c
commit
df62c78ed9
@ -247,8 +247,8 @@ Header =
|
|||||||
return unless (hash = @location.hash[1..]) and post = $.id hash
|
return unless (hash = @location.hash[1..]) and post = $.id hash
|
||||||
return if (Get.postFromRoot post).isHidden
|
return if (Get.postFromRoot post).isHidden
|
||||||
Header.scrollTo post
|
Header.scrollTo post
|
||||||
scrollTo: (post) ->
|
scrollTo: (root) ->
|
||||||
{top} = post.getBoundingClientRect()
|
{top} = root.getBoundingClientRect()
|
||||||
unless Conf['Bottom header']
|
unless Conf['Bottom header']
|
||||||
headRect = Header.toggle.getBoundingClientRect()
|
headRect = Header.toggle.getBoundingClientRect()
|
||||||
top -= headRect.top + headRect.height
|
top -= headRect.top + headRect.height
|
||||||
|
|||||||
@ -67,7 +67,7 @@ Index =
|
|||||||
notice.el.lastElementChild.textContent = 'Index refreshed!'
|
notice.el.lastElementChild.textContent = 'Index refreshed!'
|
||||||
setTimeout notice.close, $.SECOND
|
setTimeout notice.close, $.SECOND
|
||||||
|
|
||||||
Header.scrollTo $.id 'delform'
|
Header.scrollTo Index.root if Index.root.getBoundingClientRect().top < 0
|
||||||
parse: (pages) ->
|
parse: (pages) ->
|
||||||
if Conf['Index Mode'] is 'paged'
|
if Conf['Index Mode'] is 'paged'
|
||||||
pageNum = +window.location.pathname.split('/')[2]
|
pageNum = +window.location.pathname.split('/')[2]
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user