diff --git a/builds/appchan-x.user.js b/builds/appchan-x.user.js index b3c7587cb..9e0d76dc9 100644 --- a/builds/appchan-x.user.js +++ b/builds/appchan-x.user.js @@ -4203,17 +4203,15 @@ return Header.previousOffset = offsetY; }, setBarPosition: function(bottom) { + var args; + Header.barPositionToggler.checked = bottom; $.event('CloseMenu'); - if (bottom) { - $.addClass(doc, 'bottom-header'); - $.rmClass(doc, 'top-header'); - return Header.bar.parentNode.className = 'bottom'; - } else { - $.addClass(doc, 'top-header'); - $.rmClass(doc, 'bottom-header'); - return Header.bar.parentNode.className = 'top'; - } + args = bottom ? ['bottom-header', 'top-header', 'bottom', 'after'] : ['top-header', 'bottom-header', 'top', 'add']; + $.addClass(doc, args[0]); + $.rmClass(doc, args[1]); + Header.bar.parentNode.className = args[2]; + return $[args[3]](Header.bar, Header.notify); }, toggleBarPosition: function() { $.cb.checked.call(this); diff --git a/builds/crx/script.js b/builds/crx/script.js index ff0302c41..f331426ce 100644 --- a/builds/crx/script.js +++ b/builds/crx/script.js @@ -4228,17 +4228,15 @@ return Header.previousOffset = offsetY; }, setBarPosition: function(bottom) { + var args; + Header.barPositionToggler.checked = bottom; $.event('CloseMenu'); - if (bottom) { - $.addClass(doc, 'bottom-header'); - $.rmClass(doc, 'top-header'); - return Header.bar.parentNode.className = 'bottom'; - } else { - $.addClass(doc, 'top-header'); - $.rmClass(doc, 'bottom-header'); - return Header.bar.parentNode.className = 'top'; - } + args = bottom ? ['bottom-header', 'top-header', 'bottom', 'after'] : ['top-header', 'bottom-header', 'top', 'add']; + $.addClass(doc, args[0]); + $.rmClass(doc, args[1]); + Header.bar.parentNode.className = args[2]; + return $[args[3]](Header.bar, Header.notify); }, toggleBarPosition: function() { $.cb.checked.call(this); diff --git a/src/General/Header.coffee b/src/General/Header.coffee index e5743a88d..b1d4b25d2 100644 --- a/src/General/Header.coffee +++ b/src/General/Header.coffee @@ -250,14 +250,22 @@ Header = setBarPosition: (bottom) -> Header.barPositionToggler.checked = bottom $.event 'CloseMenu' - if bottom - $.addClass doc, 'bottom-header' - $.rmClass doc, 'top-header' - Header.bar.parentNode.className = 'bottom' - else - $.addClass doc, 'top-header' - $.rmClass doc, 'bottom-header' - Header.bar.parentNode.className = 'top' + args = if bottom then [ + 'bottom-header' + 'top-header' + 'bottom' + 'after' + ] else [ + 'top-header' + 'bottom-header' + 'top' + 'add' + ] + + $.addClass doc, args[0] + $.rmClass doc, args[1] + Header.bar.parentNode.className = args[2] + $[args[3]] Header.bar, Header.notify toggleBarPosition: -> $.cb.checked.call @