From 136be3763ff5a658dddbf6878b69102416822480 Mon Sep 17 00:00:00 2001 From: ccd0 Date: Sun, 1 Feb 2015 16:28:51 -0800 Subject: [PATCH] Turning off threading should hide the "Thread New Posts" link. Also simplify a little. --- src/Quotelinks/QuoteThreading.coffee | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/src/Quotelinks/QuoteThreading.coffee b/src/Quotelinks/QuoteThreading.coffee index a4f874589..f32e911d9 100755 --- a/src/Quotelinks/QuoteThreading.coffee +++ b/src/Quotelinks/QuoteThreading.coffee @@ -17,8 +17,8 @@ QuoteThreading = @input = $('input', @controls) - $.on @input, 'change', @cb.thread - $.on @threadNewLink.firstElementChild, 'click', @cb.click + $.on @input, 'change', @rethread + $.on @threadNewLink.firstElementChild, 'click', @rethread Header.menu.addEntry @entry = el: @controls @@ -99,11 +99,13 @@ QuoteThreading = return true - rethread: (enabled) -> + rethread: -> {thread} = QuoteThreading {posts} = thread - if QuoteThreading.enabled = enabled + QuoteThreading.threadNewLink.hidden = true + + if QuoteThreading.enabled = QuoteThreading.input.checked posts.forEach QuoteThreading.insert else nodes = [] @@ -125,9 +127,3 @@ QuoteThreading = Unread.setLine true Unread.read() Unread.update() - - cb: - thread: -> QuoteThreading.rethread QuoteThreading.input.checked - click: -> - QuoteThreading.threadNewLink.hidden = true - QuoteThreading.rethread true