From 3a3d89851f0a4c97806ec94fb1583a5455c53461 Mon Sep 17 00:00:00 2001 From: ccd0 Date: Mon, 29 Dec 2014 11:48:14 -0800 Subject: [PATCH] JSON Index requires RelativeDates. #259 --- src/Miscellaneous/RelativeDates.coffee | 25 +++++++++++-------------- 1 file changed, 11 insertions(+), 14 deletions(-) diff --git a/src/Miscellaneous/RelativeDates.coffee b/src/Miscellaneous/RelativeDates.coffee index 3114a2e94..c0e7d5d34 100644 --- a/src/Miscellaneous/RelativeDates.coffee +++ b/src/Miscellaneous/RelativeDates.coffee @@ -1,21 +1,18 @@ RelativeDates = INTERVAL: $.MINUTE / 2 init: -> - return unless Conf['Relative Post Dates'] - unless Conf['Relative Date Title'] - switch g.VIEW - when 'index' - @flush() - $.on d, 'visibilitychange', @flush - when 'thread' - @flush() - $.on d, 'visibilitychange ThreadUpdate', @flush if g.VIEW is 'thread' - else - return + if ( + g.VIEW isnt 'catalog' and Conf['Relative Post Dates'] and !Conf['Relative Date Title'] or + g.VIEW is 'index' and Conf['JSON Navigation'] and g.BOARD.ID isnt 'f' + ) + @flush() + $.on d, 'visibilitychange ThreadUpdate', @flush + + if Conf['Relative Post Dates'] + Post.callbacks.push + name: 'Relative Post Dates' + cb: @node - Post.callbacks.push - name: 'Relative Post Dates' - cb: @node node: -> dateEl = @nodes.date if Conf['Relative Date Title']