Fix watch thread toggler in inlined quotes.

This commit is contained in:
ccd0 2014-12-14 22:10:40 -08:00
parent 545d93a5fd
commit e87f5dcb0c

View File

@ -39,7 +39,7 @@ ThreadWatcher =
ThreadWatcher.fetchAllStatus() ThreadWatcher.fetchAllStatus()
@db.save() @db.save()
Thread.callbacks.push Post.callbacks.push
name: 'Thread Watcher' name: 'Thread Watcher'
cb: @node cb: @node
CatalogThread.callbacks.push CatalogThread.callbacks.push
@ -67,10 +67,14 @@ ThreadWatcher =
ThreadWatcher.db?.get {boardID: thread.board.ID, threadID: thread.ID} ThreadWatcher.db?.get {boardID: thread.board.ID, threadID: thread.ID}
node: -> node: ->
toggler = $.el 'img', return if @isReply
className: 'watch-thread-link' if @isClone
toggler = $ '.watch-thread-link', @nodes.post
else
toggler = $.el 'img',
className: 'watch-thread-link'
$.before $('input', @nodes.post), toggler
$.on toggler, 'click', ThreadWatcher.cb.toggle $.on toggler, 'click', ThreadWatcher.cb.toggle
$.before $('input', @OP.nodes.post), toggler
catalogNode: -> catalogNode: ->
$.addClass @nodes.root, 'watched' if ThreadWatcher.isWatched @thread $.addClass @nodes.root, 'watched' if ThreadWatcher.isWatched @thread
@ -269,14 +273,13 @@ ThreadWatcher =
$.rmAll list $.rmAll list
$.add list, nodes $.add list, nodes
{threads} = g.BOARD g.threads.forEach (thread) ->
for threadID in threads.keys
thread = threads[threadID]
helper = if ThreadWatcher.isWatched thread then ['addClass', 'Unwatch'] else ['rmClass', 'Watch'] helper = if ThreadWatcher.isWatched thread then ['addClass', 'Unwatch'] else ['rmClass', 'Watch']
if thread.OP if thread.OP
toggler = $ '.watch-thread-link', thread.OP.nodes.post for post in [thread.OP, thread.OP.clones...]
$[helper[0]] toggler, 'watched' toggler = $ '.watch-thread-link', post.nodes.post
toggler.title = "#{helper[1]} Thread" $[helper[0]] toggler, 'watched'
toggler.title = "#{helper[1]} Thread"
$[helper[0]] thread.catalogView.nodes.root, 'watched' if thread.catalogView $[helper[0]] thread.catalogView.nodes.root, 'watched' if thread.catalogView
for refresher in ThreadWatcher.menu.refreshers for refresher in ThreadWatcher.menu.refreshers