diff --git a/builds/4chan-X.js b/builds/4chan-X.js index a8162d359..0fab7e3d3 100644 --- a/builds/4chan-X.js +++ b/builds/4chan-X.js @@ -4773,7 +4773,6 @@ $.on(editCustomNav, 'click', this.editCustomNav); this.setBarFixed(Conf['Fixed Header']); this.setBarVisibility(Conf['Header auto-hide']); - this.setBarPosition(Conf['Bottom Header']); $.sync('Fixed Header', Header.setBarFixed); $.sync('Bottom Header', Header.setBarPosition); $.sync('Header auto-hide', Header.setBarVisibility); @@ -4811,28 +4810,20 @@ $.asap((function() { return $.id('boardNavMobile') || d.readyState === 'complete'; }), Header.setBoardList); - return $.prepend(d.body, _this.bar); - }); - $.ready(function() { - var a; - - if (a = $("a[href*='/" + g.BOARD + "/']", $.id('boardNavDesktopFoot'))) { - return a.className = 'current'; - } + $.prepend(d.body, _this.bar); + return _this.setBarPosition(Conf['Bottom Header']); }); return $.ready(function() { - var cs, footer; + var a, footer; + if (a = $("a[href*='/" + g.BOARD + "/']", $.id('boardNavDesktopFoot'))) { + a.className = 'current'; + } $.add(d.body, Header.hover); Header.footer = footer = $.id('boardNavDesktopFoot'); - this.footer = $.id('boardNavDesktopFoot'); + _this.footer = $.id('boardNavDesktopFoot'); Header.setFooterVisibility(Conf['Footer auto-hide']); $.sync('Footer auto-hide', Header.setFooterVisibility); - cs = $.id('settingsWindowLink'); - cs.textContent = 'Catalog Settings'; - if (g.VIEW === 'catalog') { - Header.addShortcut(cs); - } return $.sync('Bottom Board List', Header.setFooterVisibility); }); }, @@ -4945,10 +4936,12 @@ Header.barPositionToggler.checked = bottom; if (bottom) { $.rmClass(doc, 'top'); - return $.addClass(doc, 'bottom'); + $.addClass(doc, 'bottom'); + return $.after(Header.bar, Header.notify); } else { $.rmClass(doc, 'bottom'); - return $.addClass(doc, 'top'); + $.addClass(doc, 'top'); + return $.add(Header.bar, Header.notify); } }, toggleBarPosition: function() { @@ -5012,7 +5005,7 @@ cust = $('#custom-board-list', Header.bar); full = $('#full-board-list', Header.bar); btn = $('.hide-board-list-button', full); - return _ref = show ? [false, true, false] : [true, false, true], cust.hidden = _ref[0], full.hidden = _ref[1], _ref; + return _ref = show ? [false, true] : [true, false], cust.hidden = _ref[0], full.hidden = _ref[1], _ref; }, toggleCustomNav: function() { $.cb.checked.call(this); diff --git a/builds/4chan-X.user.js b/builds/4chan-X.user.js index 42ec943b0..064caca8b 100644 --- a/builds/4chan-X.user.js +++ b/builds/4chan-X.user.js @@ -4764,7 +4764,6 @@ $.on(editCustomNav, 'click', this.editCustomNav); this.setBarFixed(Conf['Fixed Header']); this.setBarVisibility(Conf['Header auto-hide']); - this.setBarPosition(Conf['Bottom Header']); $.sync('Fixed Header', Header.setBarFixed); $.sync('Bottom Header', Header.setBarPosition); $.sync('Header auto-hide', Header.setBarVisibility); @@ -4802,28 +4801,20 @@ $.asap((function() { return $.id('boardNavMobile') || d.readyState === 'complete'; }), Header.setBoardList); - return $.prepend(d.body, _this.bar); - }); - $.ready(function() { - var a; - - if (a = $("a[href*='/" + g.BOARD + "/']", $.id('boardNavDesktopFoot'))) { - return a.className = 'current'; - } + $.prepend(d.body, _this.bar); + return _this.setBarPosition(Conf['Bottom Header']); }); return $.ready(function() { - var cs, footer; + var a, footer; + if (a = $("a[href*='/" + g.BOARD + "/']", $.id('boardNavDesktopFoot'))) { + a.className = 'current'; + } $.add(d.body, Header.hover); Header.footer = footer = $.id('boardNavDesktopFoot'); - this.footer = $.id('boardNavDesktopFoot'); + _this.footer = $.id('boardNavDesktopFoot'); Header.setFooterVisibility(Conf['Footer auto-hide']); $.sync('Footer auto-hide', Header.setFooterVisibility); - cs = $.id('settingsWindowLink'); - cs.textContent = 'Catalog Settings'; - if (g.VIEW === 'catalog') { - Header.addShortcut(cs); - } return $.sync('Bottom Board List', Header.setFooterVisibility); }); }, @@ -4936,10 +4927,12 @@ Header.barPositionToggler.checked = bottom; if (bottom) { $.rmClass(doc, 'top'); - return $.addClass(doc, 'bottom'); + $.addClass(doc, 'bottom'); + return $.after(Header.bar, Header.notify); } else { $.rmClass(doc, 'bottom'); - return $.addClass(doc, 'top'); + $.addClass(doc, 'top'); + return $.add(Header.bar, Header.notify); } }, toggleBarPosition: function() { @@ -5003,7 +4996,7 @@ cust = $('#custom-board-list', Header.bar); full = $('#full-board-list', Header.bar); btn = $('.hide-board-list-button', full); - return _ref = show ? [false, true, false] : [true, false, true], cust.hidden = _ref[0], full.hidden = _ref[1], _ref; + return _ref = show ? [false, true] : [true, false], cust.hidden = _ref[0], full.hidden = _ref[1], _ref; }, toggleCustomNav: function() { $.cb.checked.call(this); diff --git a/builds/crx/script.js b/builds/crx/script.js index 679df1c62..3aed15ae9 100644 --- a/builds/crx/script.js +++ b/builds/crx/script.js @@ -4628,7 +4628,6 @@ $.on(editCustomNav, 'click', this.editCustomNav); this.setBarFixed(Conf['Fixed Header']); this.setBarVisibility(Conf['Header auto-hide']); - this.setBarPosition(Conf['Bottom Header']); $.sync('Fixed Header', Header.setBarFixed); $.sync('Bottom Header', Header.setBarPosition); $.sync('Header auto-hide', Header.setBarVisibility); @@ -4666,28 +4665,20 @@ $.asap((function() { return $.id('boardNavMobile') || d.readyState === 'complete'; }), Header.setBoardList); - return $.prepend(d.body, _this.bar); - }); - $.ready(function() { - var a; - - if (a = $("a[href*='/" + g.BOARD + "/']", $.id('boardNavDesktopFoot'))) { - return a.className = 'current'; - } + $.prepend(d.body, _this.bar); + return _this.setBarPosition(Conf['Bottom Header']); }); return $.ready(function() { - var cs, footer; + var a, footer; + if (a = $("a[href*='/" + g.BOARD + "/']", $.id('boardNavDesktopFoot'))) { + a.className = 'current'; + } $.add(d.body, Header.hover); Header.footer = footer = $.id('boardNavDesktopFoot'); - this.footer = $.id('boardNavDesktopFoot'); + _this.footer = $.id('boardNavDesktopFoot'); Header.setFooterVisibility(Conf['Footer auto-hide']); $.sync('Footer auto-hide', Header.setFooterVisibility); - cs = $.id('settingsWindowLink'); - cs.textContent = 'Catalog Settings'; - if (g.VIEW === 'catalog') { - Header.addShortcut(cs); - } return $.sync('Bottom Board List', Header.setFooterVisibility); }); }, @@ -4800,10 +4791,12 @@ Header.barPositionToggler.checked = bottom; if (bottom) { $.rmClass(doc, 'top'); - return $.addClass(doc, 'bottom'); + $.addClass(doc, 'bottom'); + return $.after(Header.bar, Header.notify); } else { $.rmClass(doc, 'bottom'); - return $.addClass(doc, 'top'); + $.addClass(doc, 'top'); + return $.add(Header.bar, Header.notify); } }, toggleBarPosition: function() { @@ -4867,7 +4860,7 @@ cust = $('#custom-board-list', Header.bar); full = $('#full-board-list', Header.bar); btn = $('.hide-board-list-button', full); - return _ref = show ? [false, true, false] : [true, false, true], cust.hidden = _ref[0], full.hidden = _ref[1], _ref; + return _ref = show ? [false, true] : [true, false], cust.hidden = _ref[0], full.hidden = _ref[1], _ref; }, toggleCustomNav: function() { $.cb.checked.call(this); diff --git a/src/features/misc/header.coffee b/src/features/misc/header.coffee index f98cf51ac..83e517085 100644 --- a/src/features/misc/header.coffee +++ b/src/features/misc/header.coffee @@ -35,7 +35,6 @@ Header = @setBarFixed Conf['Fixed Header'] @setBarVisibility Conf['Header auto-hide'] - @setBarPosition Conf['Bottom Header'] $.sync 'Fixed Header', Header.setBarFixed $.sync 'Bottom Header', Header.setBarPosition @@ -66,21 +65,17 @@ Header = # it might be incomplete otherwise. $.asap (-> $.id('boardNavMobile') or d.readyState is 'complete'), Header.setBoardList $.prepend d.body, @bar + @setBarPosition Conf['Bottom Header'] $.ready => if a = $ "a[href*='/#{g.BOARD}/']", $.id 'boardNavDesktopFoot' a.className = 'current' - $.ready -> $.add d.body, Header.hover Header.footer = footer = $.id 'boardNavDesktopFoot' @footer = $.id 'boardNavDesktopFoot' Header.setFooterVisibility Conf['Footer auto-hide'] $.sync 'Footer auto-hide', Header.setFooterVisibility - cs = $.id('settingsWindowLink') - cs.textContent = 'Catalog Settings' - if g.VIEW is 'catalog' - Header.addShortcut cs $.sync 'Bottom Board List', Header.setFooterVisibility bar: $.el 'div', @@ -175,9 +170,11 @@ Header = if bottom $.rmClass doc, 'top' $.addClass doc, 'bottom' + $.after Header.bar, Header.notify else $.rmClass doc, 'bottom' $.addClass doc, 'top' + $.add Header.bar, Header.notify toggleBarPosition: -> $.event 'CloseMenu' @@ -248,9 +245,9 @@ Header = full = $ '#full-board-list', Header.bar btn = $ '.hide-board-list-button', full [cust.hidden, full.hidden] = if show - [false, true, false] + [false, true] else - [true, false, true] + [true, false] toggleCustomNav: -> $.cb.checked.call @