From 344f5a7c82b6b41d096ead98f8ea3afb087fa816 Mon Sep 17 00:00:00 2001 From: ccd0 Date: Tue, 7 Apr 2015 10:11:11 -0700 Subject: [PATCH] Break up 'Toggleable Thread Watcher' into 'Fixed' and 'Toggleable' parts. #40 --- src/General/Config.coffee | 7 ++++++- src/General/Main.coffee | 2 ++ src/General/css/style.css | 4 ++-- src/Monitoring/ThreadWatcher.coffee | 10 +++++----- 4 files changed, 15 insertions(+), 8 deletions(-) diff --git a/src/General/Config.coffee b/src/General/Config.coffee index 82ead9651..0851d933e 100755 --- a/src/General/Config.coffee +++ b/src/General/Config.coffee @@ -377,9 +377,14 @@ Config = true 'Bookmark threads.' ] + 'Fixed Thread Watcher': [ + null # XXX temporarily set in Main.coffee so old versions update to correct setting + 'Makes the thread watcher scroll with the page.' + 1 + ] 'Toggleable Thread Watcher': [ true - 'Adds a shortcut for the thread watcher, hides the watcher by default, and makes it scroll with the page.' + 'Adds a shortcut for the thread watcher and hides the watcher by default.' 1 ] 'Mark New IPs': [ diff --git a/src/General/Main.coffee b/src/General/Main.coffee index e3244468c..295f84625 100755 --- a/src/General/Main.coffee +++ b/src/General/Main.coffee @@ -43,6 +43,8 @@ Main = $.get Conf, (items) -> $.extend Conf, items + # XXX temporarily set here so old versions update to correct setting + Conf['Fixed Thread Watcher'] ?= Conf['Toggleable Thread Watcher'] $.asap (-> doc = d.documentElement), Main.initFeatures # set up CSS when is completely loaded diff --git a/src/General/css/style.css b/src/General/css/style.css index c3c55c8ad..1a668ce11 100755 --- a/src/General/css/style.css +++ b/src/General/css/style.css @@ -803,7 +803,7 @@ span.hide-announcement { :root.fixed-watcher #thread-watcher { position: fixed; } -:root:not(.fixed-watcher) #thread-watcher:not(:hover) { +:root:not(.toggleable-watcher) #thread-watcher:not(:hover) { max-height: 210px; overflow-y: hidden; } @@ -837,7 +837,7 @@ span.hide-announcement { #thread-watcher a { text-decoration: none; } -:root:not(.fixed-watcher) #thread-watcher .move > .close { +:root:not(.toggleable-watcher) #thread-watcher .move > .close { display: none; } #thread-watcher .move > .close { diff --git a/src/Monitoring/ThreadWatcher.coffee b/src/Monitoring/ThreadWatcher.coffee index 21c229b00..6e6ecc648 100755 --- a/src/Monitoring/ThreadWatcher.coffee +++ b/src/Monitoring/ThreadWatcher.coffee @@ -18,9 +18,6 @@ ThreadWatcher = @closeButton = $('.move > .close', @dialog) @unreaddb = Unread.db or new DataBoard 'lastReadPosts' - if Conf['Toggleable Thread Watcher'] - @dialog.hidden = true - $.on d, 'QRPostSuccessful', @cb.post $.on sc, 'click', @toggleWatcher $.on @refreshButton, 'click', @fetchAllStatus @@ -34,9 +31,12 @@ ThreadWatcher = when 'thread' $.on d, 'ThreadUpdate', @cb.onThreadRefresh - if Conf['Toggleable Thread Watcher'] - Header.addShortcut sc + if Conf['Fixed Thread Watcher'] $.addClass doc, 'fixed-watcher' + if Conf['Toggleable Thread Watcher'] + @dialog.hidden = true + Header.addShortcut sc + $.addClass doc, 'toggleable-watcher' ThreadWatcher.fetchAuto()