From 0adc86b39224ceae3167cf90cf59545ffe76f0c0 Mon Sep 17 00:00:00 2001 From: Nicolas Stepien Date: Mon, 11 Feb 2013 17:19:58 +0100 Subject: [PATCH] That works too. --- 4chan_x.user.js | 9 +++------ src/features.coffee | 7 ++++--- 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/4chan_x.user.js b/4chan_x.user.js index 2ca52b05a..916a14640 100644 --- a/4chan_x.user.js +++ b/4chan_x.user.js @@ -967,12 +967,9 @@ return $('.board-list', headerEl).hidden = !showBoardList; }, toggleBar: function() { - var isAutohiding; - if (isAutohiding = $.id('header-bar').classList.toggle('autohide')) { - new Notification('info', 'The header bar will automatically hide itself.', 2); - } else { - new Notification('info', 'The header bar will remain visible.', 2); - } + var isAutohiding, message; + message = (isAutohiding = $.id('header-bar').classList.toggle('autohide')) ? 'The header bar will automatically hide itself.' : 'The header bar will remain visible.'; + new Notification('info', message, 2); return $.set('autohideHeaderBar', isAutohiding); }, menuToggle: function(e) { diff --git a/src/features.coffee b/src/features.coffee index 44e622190..3c197a175 100644 --- a/src/features.coffee +++ b/src/features.coffee @@ -62,10 +62,11 @@ Header = $('.board-list', headerEl).hidden = !showBoardList toggleBar: -> - if isAutohiding = $.id('header-bar').classList.toggle 'autohide' - new Notification 'info', 'The header bar will automatically hide itself.', 2 + message = if isAutohiding = $.id('header-bar').classList.toggle 'autohide' + 'The header bar will automatically hide itself.' else - new Notification 'info', 'The header bar will remain visible.', 2 + 'The header bar will remain visible.' + new Notification 'info', message, 2 $.set 'autohideHeaderBar', isAutohiding menuToggle: (e) ->