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) ->