Remove Index.followedThreadID. Changing pinned watched threads only immediately resorts in catalog mode now.

This commit is contained in:
ccd0 2016-09-17 04:25:09 -07:00
parent 4db8b753a6
commit 4c77245428
2 changed files with 1 additions and 13 deletions

View File

@ -693,14 +693,6 @@ Index =
when 'all pages', 'catalog'
threads = Index.sortedThreads
else
if Index.followedThreadID?
i = 0
i++ while Index.followedThreadID isnt Index.sortedThreads[i].ID
page = i // Index.threadsNumPerPage + 1
if page isnt Index.currentPage
Index.currentPage = page
Index.pushState {page}
Index.setPage()
threads = Index.threadsOnPage Index.currentPage
delete Index.pageNum
$.rmAll Index.root
@ -714,8 +706,6 @@ Index =
else
Index.buildReplies threads if Conf['Show Replies']
Index.buildStructure threads
if Index.followedThreadID? and (post = g.posts["#{g.BOARD}.#{Index.followedThreadID}"])
Header.scrollTo post.nodes.root
threadsOnPage: (pageNum) ->
nodesPerPage = Index.threadsNumPerPage

View File

@ -125,9 +125,7 @@ ThreadWatcher =
$.event 'CloseMenu'
toggle: ->
{thread} = Get.postFromNode @
Index.followedThreadID = thread.ID
ThreadWatcher.toggle thread
delete Index.followedThreadID
rm: ->
[boardID, threadID] = @parentNode.dataset.fullID.split '.'
ThreadWatcher.rm boardID, +threadID
@ -338,7 +336,7 @@ ThreadWatcher =
for refresher in ThreadWatcher.menu.refreshers
refresher()
if Index.nodes and Conf['Pin Watched Threads']
if Index.nodes and Conf['Pin Watched Threads'] and Conf['Index Mode'] is 'catalog'
Index.sort()
Index.buildIndex()