diff --git a/src/Filtering/ThreadHiding.coffee b/src/Filtering/ThreadHiding.coffee index 11c5015b3..c225c0056 100644 --- a/src/Filtering/ThreadHiding.coffee +++ b/src/Filtering/ThreadHiding.coffee @@ -19,8 +19,7 @@ ThreadHiding = for threadID, thread of g.BOARD.threads when thread.isHidden root = thread.OP.nodes.root.parentNode if thread.stub - thread.stub = ThreadHiding.makeStub thread, root - $.prepend root, thread.stub + ThreadHiding.makeStub thread, root else root.nextElementSibling.hidden = true return @@ -120,13 +119,13 @@ ThreadHiding = a = ThreadHiding.makeButton thread, 'show' $.add a, $.tn " #{opInfo} (#{if numReplies is 1 then '1 reply' else "#{numReplies} replies"})" - stub = $.el 'div', + thread.stub = $.el 'div', className: 'stub' if Conf['Menu'] - $.add stub, [a, $.tn(' '), Menu.makeButton()] + $.add thread.stub, [a, $.tn(' '), Menu.makeButton()] else - $.add stub, a - stub + $.add thread.stub, a + $.prepend root, thread.stub saveHiddenState: (thread, makeStub) -> hiddenThreadsOnCatalog = JSON.parse(localStorage.getItem "4chan-hide-t-#{g.BOARD}") or {} @@ -154,16 +153,14 @@ ThreadHiding = hide: (thread, makeStub=Conf['Stubs']) -> return if thread.isHidden - {OP} = thread - threadRoot = OP.nodes.root.parentNode + threadRoot = thread.OP.nodes.root.parentNode thread.isHidden = true unless makeStub threadRoot.hidden = threadRoot.nextElementSibling.hidden = true #
return - thread.stub = ThreadHiding.makeStub thread, threadRoot - $.prepend threadRoot, thread.stub + ThreadHiding.makeStub thread, threadRoot show: (thread) -> if thread.stub diff --git a/src/Miscellaneous/ExpandThread.coffee b/src/Miscellaneous/ExpandThread.coffee index d9efaa2b0..608572cf7 100644 --- a/src/Miscellaneous/ExpandThread.coffee +++ b/src/Miscellaneous/ExpandThread.coffee @@ -3,11 +3,6 @@ ExpandThread = return if g.VIEW isnt 'index' or !Conf['Thread Expansion'] @statuses = {} $.on d, 'IndexRefresh', @onIndexRefresh - Thread.callbacks.push - name: 'Thread Expansion' - cb: @node - node: -> - ExpandThread.setButton @ setButton: (thread) -> return unless a = $.x 'following-sibling::a[contains(@class,"summary")][1]', thread.OP.nodes.root