From 1b6095ec2663001c858c7ddb911bf10fcb405d06 Mon Sep 17 00:00:00 2001 From: ccd0 Date: Sat, 2 Apr 2016 22:55:22 -0700 Subject: [PATCH] Fix total not being updated when pruning checkbox was disabled. Also simplify. --- src/Monitoring/ReplyPruning.coffee | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/src/Monitoring/ReplyPruning.coffee b/src/Monitoring/ReplyPruning.coffee index 7cb060b69..932aa4d88 100644 --- a/src/Monitoring/ReplyPruning.coffee +++ b/src/Monitoring/ReplyPruning.coffee @@ -33,16 +33,9 @@ ReplyPruning = node: -> ReplyPruning.thread = @ ReplyPruning.total = @posts.keys.length - 1 - $.on ReplyPruning.inputs.enabled, 'change', ReplyPruning.setEnabled $.on ReplyPruning.inputs.enabled, 'change', ReplyPruning.update - if Conf['Prune Replies'] - ReplyPruning.setEnabled() - ReplyPruning.update() - - setEnabled: -> - onOff = if Conf['Prune Replies'] then $.on else $.off - onOff ReplyPruning.inputs.replies, 'change', ReplyPruning.update - onOff d, 'ThreadUpdate', ReplyPruning.update + $.on ReplyPruning.inputs.replies, 'change', ReplyPruning.update + $.on d, 'ThreadUpdate', ReplyPruning.update update: (e) -> if e and e.type is 'ThreadUpdate' and not e.detail[404]