Scrolling to post hidden by Reply Pruning unhides post. This includes 'Scroll to Last Read Post'.
This commit is contained in:
parent
0065037bdc
commit
0e8fade646
@ -439,8 +439,10 @@ Header =
|
|||||||
return if e.state
|
return if e.state
|
||||||
history.replaceState {}, '' unless history.state
|
history.replaceState {}, '' unless history.state
|
||||||
|
|
||||||
if (hash = location.hash[1..]) and (el = $.id hash)
|
if (hash = location.hash[1..])
|
||||||
$.queueTask -> Header.scrollTo el
|
ReplyPruning.showIfHidden hash
|
||||||
|
if (el = $.id hash)
|
||||||
|
$.queueTask -> Header.scrollTo el
|
||||||
|
|
||||||
scrollTo: (root, down, needed) ->
|
scrollTo: (root, down, needed) ->
|
||||||
return unless root.offsetParent # hidden or fixed
|
return unless root.offsetParent # hidden or fixed
|
||||||
|
|||||||
@ -51,6 +51,11 @@ ReplyPruning =
|
|||||||
$.event 'change', null, other
|
$.event 'change', null, other
|
||||||
$.cb.checked.call @
|
$.cb.checked.call @
|
||||||
|
|
||||||
|
showIfHidden: (id) ->
|
||||||
|
if ReplyPruning.container?.getElementById id
|
||||||
|
ReplyPruning.inputs.enabled.checked = false
|
||||||
|
$.event 'change', null, ReplyPruning.inputs.enabled
|
||||||
|
|
||||||
node: ->
|
node: ->
|
||||||
ReplyPruning.thread = @
|
ReplyPruning.thread = @
|
||||||
|
|
||||||
|
|||||||
@ -63,9 +63,9 @@ Unread =
|
|||||||
|
|
||||||
ready: ->
|
ready: ->
|
||||||
Unread.setLine true
|
Unread.setLine true
|
||||||
|
Unread.scroll() if Conf['Remember Last Read Post'] and Conf['Scroll to Last Read Post']
|
||||||
Unread.read()
|
Unread.read()
|
||||||
Unread.update()
|
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, 'scroll visibilitychange', Unread.read
|
||||||
$.on d, 'visibilitychange', Unread.setLine if Conf['Unread Line']
|
$.on d, 'visibilitychange', Unread.setLine if Conf['Unread Line']
|
||||||
|
|
||||||
@ -76,6 +76,8 @@ Unread =
|
|||||||
# Let the header's onload callback handle it.
|
# Let the header's onload callback handle it.
|
||||||
return if (hash = location.hash.match /\d+/) and hash[0] of Unread.thread.posts
|
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()
|
position = Unread.positionPrev()
|
||||||
while position
|
while position
|
||||||
{root} = position.data.nodes
|
{root} = position.data.nodes
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user