Revert most of "Also avoid full Thread Watcher rebuild on removing entry."
This reverts most of commit 4fe17ac6efd669d2bfee09adfd44951bbf612732. Keep consolidation of duplicated code.
This commit is contained in:
parent
2cd93c858f
commit
28093b2348
@ -494,9 +494,6 @@ ThreadWatcher =
|
|||||||
ThreadWatcher.shortcut.classList.toggle className, !!$(".#{className}", ThreadWatcher.dialog)
|
ThreadWatcher.shortcut.classList.toggle className, !!$(".#{className}", ThreadWatcher.dialog)
|
||||||
return
|
return
|
||||||
|
|
||||||
getLine: (siteID, boardID, threadID) ->
|
|
||||||
$ "#watched-threads > [data-site-i-d='#{siteID}'][data-full-i-d='#{boardID}.#{threadID}']", ThreadWatcher.dialog
|
|
||||||
|
|
||||||
update: (siteID, boardID, threadID, newData) ->
|
update: (siteID, boardID, threadID, newData) ->
|
||||||
return if not (data = ThreadWatcher.db?.get {siteID, boardID, threadID})
|
return if not (data = ThreadWatcher.db?.get {siteID, boardID, threadID})
|
||||||
if newData.isDead and Conf['Auto Prune']
|
if newData.isDead and Conf['Auto Prune']
|
||||||
@ -509,7 +506,7 @@ ThreadWatcher =
|
|||||||
n++ for key, val of newData when data[key] isnt val
|
n++ for key, val of newData when data[key] isnt val
|
||||||
return unless n
|
return unless n
|
||||||
ThreadWatcher.db.extend {siteID, boardID, threadID, val: newData}
|
ThreadWatcher.db.extend {siteID, boardID, threadID, val: newData}
|
||||||
if (line = ThreadWatcher.getLine siteID, boardID, threadID)
|
if (line = $ "#watched-threads > [data-site-i-d='#{siteID}'][data-full-i-d='#{boardID}.#{threadID}']", ThreadWatcher.dialog)
|
||||||
newLine = ThreadWatcher.makeLine siteID, boardID, threadID, data
|
newLine = ThreadWatcher.makeLine siteID, boardID, threadID, data
|
||||||
$.replace line, newLine
|
$.replace line, newLine
|
||||||
ThreadWatcher.refreshIcon()
|
ThreadWatcher.refreshIcon()
|
||||||
@ -557,7 +554,7 @@ ThreadWatcher =
|
|||||||
|
|
||||||
rm: (siteID, boardID, threadID) ->
|
rm: (siteID, boardID, threadID) ->
|
||||||
ThreadWatcher.db.delete {siteID, boardID, threadID}
|
ThreadWatcher.db.delete {siteID, boardID, threadID}
|
||||||
$.rm ThreadWatcher.getLine(siteID, boardID, threadID)
|
ThreadWatcher.refresh()
|
||||||
|
|
||||||
menu:
|
menu:
|
||||||
init: ->
|
init: ->
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user