Scrolling to post hidden by Reply Pruning unhides post. This includes 'Scroll to Last Read Post'.

This commit is contained in:
ccd0 2016-04-03 21:34:19 -07:00
parent 0065037bdc
commit 0e8fade646
3 changed files with 12 additions and 3 deletions

View File

@ -439,7 +439,9 @@ Header =
return if e.state
history.replaceState {}, '' unless history.state
if (hash = location.hash[1..]) and (el = $.id hash)
if (hash = location.hash[1..])
ReplyPruning.showIfHidden hash
if (el = $.id hash)
$.queueTask -> Header.scrollTo el
scrollTo: (root, down, needed) ->

View File

@ -51,6 +51,11 @@ ReplyPruning =
$.event 'change', null, other
$.cb.checked.call @
showIfHidden: (id) ->
if ReplyPruning.container?.getElementById id
ReplyPruning.inputs.enabled.checked = false
$.event 'change', null, ReplyPruning.inputs.enabled
node: ->
ReplyPruning.thread = @

View File

@ -63,9 +63,9 @@ Unread =
ready: ->
Unread.setLine true
Unread.scroll() if Conf['Remember Last Read Post'] and Conf['Scroll to Last Read Post']
Unread.read()
Unread.update()
Unread.scroll() if Conf['Remember Last Read Post'] and Conf['Scroll to Last Read Post']
$.on d, 'scroll visibilitychange', Unread.read
$.on d, 'visibilitychange', Unread.setLine if Conf['Unread Line']
@ -76,6 +76,8 @@ Unread =
# Let the header's onload callback handle it.
return if (hash = location.hash.match /\d+/) and hash[0] of Unread.thread.posts
ReplyPruning.showIfHidden Unread.position?.data.nodes.root.id
position = Unread.positionPrev()
while position
{root} = position.data.nodes