Let UnreadIndex handle removing unread line on contraction using PostsRemoved event.
This commit is contained in:
parent
87fe975ac6
commit
70bcd9dc1b
@ -77,8 +77,6 @@ ExpandThread =
|
||||
postsCount = 0
|
||||
filesCount = 0
|
||||
for reply in replies
|
||||
# rm elements above post such as unread line
|
||||
$.rm node while (node = a.nextSibling) and node isnt reply
|
||||
# rm clones
|
||||
inlined.click() while inlined = $ '.inlined', reply if Conf['Quote Inlining']
|
||||
postsCount++
|
||||
|
||||
@ -14,7 +14,7 @@ UnreadIndex =
|
||||
cb: @node
|
||||
|
||||
$.on d, 'IndexRefreshInternal', @onIndexRefresh
|
||||
$.on d, 'PostsInserted', @onPostsInserted
|
||||
$.on d, 'PostsInserted PostsRemoved', @onPostsInserted
|
||||
|
||||
node: ->
|
||||
UnreadIndex.lastReadPost[@fullID] = UnreadIndex.db.get(
|
||||
@ -36,7 +36,7 @@ UnreadIndex =
|
||||
return if !thread or thread.nodes.root isnt e.target
|
||||
wasVisible = !!UnreadIndex.hr[thread.fullID]?.parentNode
|
||||
UnreadIndex.update thread
|
||||
if Conf['Scroll to Last Read Post'] and !wasVisible and !!UnreadIndex.hr[thread.fullID]?.parentNode
|
||||
if Conf['Scroll to Last Read Post'] and e.type is 'PostsInserted' and !wasVisible and !!UnreadIndex.hr[thread.fullID]?.parentNode
|
||||
Header.scrollToIfNeeded UnreadIndex.hr[thread.fullID], true
|
||||
|
||||
sync: ->
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user