diff --git a/4chan_x.user.js b/4chan_x.user.js index a70aef18b..c07d413a9 100644 --- a/4chan_x.user.js +++ b/4chan_x.user.js @@ -2085,14 +2085,15 @@ return ThreadHiding.saveHiddenState(thread); }, hide: function(thread, makeStub) { - var a, numReplies, opInfo, span, threadRoot; + var OP, a, numReplies, opInfo, span, threadRoot; if (makeStub == null) { makeStub = Conf['Stubs']; } if (thread.hidden) { return; } - threadRoot = thread.OP.nodes.root.parentNode; + OP = thread.OP; + threadRoot = OP.nodes.root.parentNode; threadRoot.hidden = thread.isHidden = true; if (!makeStub) { threadRoot.nextElementSibling.hidden = true; @@ -2104,7 +2105,7 @@ } numReplies += $$('.opContainer ~ .replyContainer', threadRoot).length; numReplies = numReplies === 1 ? '1 reply' : "" + numReplies + " replies"; - opInfo = Conf['Anonymize'] ? 'Anonymous' : $('.nameBlock', op.nodes.info).textContent; + opInfo = Conf['Anonymize'] ? 'Anonymous' : $('.nameBlock', OP.nodes.info).textContent; a = ThreadHiding.makeButton(thread, 'show'); $.add(a, $.tn(" " + opInfo + " (" + numReplies + ")")); thread.stub = $.el('div', { @@ -2112,7 +2113,7 @@ }); $.add(thread.stub, a); if (Conf['Menu']) { - $.add(thread.stub, [$.tn(' '), Menu.makeButton(op)]); + $.add(thread.stub, [$.tn(' '), Menu.makeButton(OP)]); } return $.before(threadRoot, thread.stub); }, diff --git a/src/features.coffee b/src/features.coffee index fc5c94659..3ebf53fb2 100644 --- a/src/features.coffee +++ b/src/features.coffee @@ -1008,7 +1008,8 @@ ThreadHiding = hide: (thread, makeStub=Conf['Stubs']) -> return if thread.hidden - threadRoot = thread.OP.nodes.root.parentNode + {OP} = thread + threadRoot = OP.nodes.root.parentNode threadRoot.hidden = thread.isHidden = true unless makeStub @@ -1024,7 +1025,7 @@ ThreadHiding = if Conf['Anonymize'] 'Anonymous' else - $('.nameBlock', op.nodes.info).textContent + $('.nameBlock', OP.nodes.info).textContent a = ThreadHiding.makeButton thread, 'show' $.add a, $.tn " #{opInfo} (#{numReplies})" @@ -1032,7 +1033,7 @@ ThreadHiding = className: 'stub' $.add thread.stub, a if Conf['Menu'] - $.add thread.stub, [$.tn(' '), Menu.makeButton op] + $.add thread.stub, [$.tn(' '), Menu.makeButton OP] $.before threadRoot, thread.stub show: (thread) ->