Fix header position syncronization
This commit is contained in:
parent
e93b533ea4
commit
23d832afb3
@ -5146,7 +5146,7 @@
|
|||||||
return section.scrollTop = 0;
|
return section.scrollTop = 0;
|
||||||
},
|
},
|
||||||
main: function(section) {
|
main: function(section) {
|
||||||
var arr, button, description, div, fs, hiddenNum, input, inputs, items, key, obj, unhide, _ref;
|
var arr, button, description, div, fs, hiddenNum, input, inputs, items, key, obj, _ref;
|
||||||
|
|
||||||
section.innerHTML = "<div class=imp-exp>\n <button class=export>Export Settings</button>\n <button class=import>Import Settings</button>\n <input type=file style='visibility:hidden'>\n</div>\n<p class=imp-exp-result></p>";
|
section.innerHTML = "<div class=imp-exp>\n <button class=export>Export Settings</button>\n <button class=import>Import Settings</button>\n <input type=file style='visibility:hidden'>\n</div>\n<p class=imp-exp-result></p>";
|
||||||
$.on($('.export', section), 'click', Settings["export"]);
|
$.on($('.export', section), 'click', Settings["export"]);
|
||||||
@ -5235,17 +5235,7 @@
|
|||||||
return $["delete"](['hiddenThreads', 'hiddenPosts']);
|
return $["delete"](['hiddenThreads', 'hiddenPosts']);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
$.after($('input[name="Stubs"]', section).parentNode.parentNode, div);
|
return $.after($('input[name="Stubs"]', section).parentNode.parentNode, div);
|
||||||
div = $.el('div', {
|
|
||||||
innerHTML: "<button>Reset Header</button><span class=description>: Unhide the navigation bar."
|
|
||||||
});
|
|
||||||
unhide = $('button', div);
|
|
||||||
$.on(unhide, 'click', function() {
|
|
||||||
return Header.setBarPosition.call({
|
|
||||||
textContent: "sticky top"
|
|
||||||
});
|
|
||||||
});
|
|
||||||
return $.after($('input[name="Check for Updates"]', section).parentNode.parentNode, div);
|
|
||||||
},
|
},
|
||||||
"export": function(now, data) {
|
"export": function(now, data) {
|
||||||
var a, db, p, _i, _len;
|
var a, db, p, _i, _len;
|
||||||
@ -6159,11 +6149,7 @@
|
|||||||
Header.setBarPosition.call({
|
Header.setBarPosition.call({
|
||||||
textContent: "" + Conf['Boards Navigation']
|
textContent: "" + Conf['Boards Navigation']
|
||||||
});
|
});
|
||||||
$.sync('Boards Navigation', function() {
|
$.sync('Boards Navigation', Header.changeBarPosition);
|
||||||
return Header.setBarPosition.call({
|
|
||||||
textContent: "" + Conf['Boards Navigation']
|
|
||||||
});
|
|
||||||
});
|
|
||||||
Header.setBarVisibility(Conf['Header auto-hide']);
|
Header.setBarVisibility(Conf['Header auto-hide']);
|
||||||
$.sync('Header auto-hide', Header.setBarVisibility);
|
$.sync('Header auto-hide', Header.setBarVisibility);
|
||||||
$.prepend(d.body, settings = $.id('navtopright'));
|
$.prepend(d.body, settings = $.id('navtopright'));
|
||||||
@ -6250,33 +6236,33 @@
|
|||||||
},
|
},
|
||||||
setBarPosition: function() {
|
setBarPosition: function() {
|
||||||
$.event('CloseMenu');
|
$.event('CloseMenu');
|
||||||
switch (this.textContent) {
|
Header.changeBarPosition(this.textContent);
|
||||||
|
Conf['Boards Navigation'] = this.textContent;
|
||||||
|
return $.set('Boards Navigation', this.textContent);
|
||||||
|
},
|
||||||
|
changeBarPosition: function(setting) {
|
||||||
|
switch (setting) {
|
||||||
case 'sticky top':
|
case 'sticky top':
|
||||||
$.addClass(doc, 'top');
|
$.addClass(doc, 'top');
|
||||||
$.addClass(doc, 'fixed');
|
$.addClass(doc, 'fixed');
|
||||||
$.rmClass(doc, 'bottom');
|
$.rmClass(doc, 'bottom');
|
||||||
$.rmClass(doc, 'hide');
|
return $.rmClass(doc, 'hide');
|
||||||
break;
|
|
||||||
case 'sticky bottom':
|
case 'sticky bottom':
|
||||||
$.rmClass(doc, 'top');
|
$.rmClass(doc, 'top');
|
||||||
$.addClass(doc, 'fixed');
|
$.addClass(doc, 'fixed');
|
||||||
$.addClass(doc, 'bottom');
|
$.addClass(doc, 'bottom');
|
||||||
$.rmClass(doc, 'hide');
|
return $.rmClass(doc, 'hide');
|
||||||
break;
|
|
||||||
case 'top':
|
case 'top':
|
||||||
$.addClass(doc, 'top');
|
$.addClass(doc, 'top');
|
||||||
$.rmClass(doc, 'fixed');
|
$.rmClass(doc, 'fixed');
|
||||||
$.rmClass(doc, 'bottom');
|
$.rmClass(doc, 'bottom');
|
||||||
$.rmClass(doc, 'hide');
|
return $.rmClass(doc, 'hide');
|
||||||
break;
|
|
||||||
case 'hide':
|
case 'hide':
|
||||||
$.rmClass(doc, 'top');
|
$.rmClass(doc, 'top');
|
||||||
$.rmClass(doc, 'fixed');
|
$.rmClass(doc, 'fixed');
|
||||||
$.rmClass(doc, 'bottom');
|
$.rmClass(doc, 'bottom');
|
||||||
$.addClass(doc, 'hide');
|
return $.addClass(doc, 'hide');
|
||||||
}
|
}
|
||||||
Conf['Boards Navigation'] = this.textContent;
|
|
||||||
return $.set('Boards Navigation', this.textContent);
|
|
||||||
},
|
},
|
||||||
setBarVisibility: function(hide) {
|
setBarVisibility: function(hide) {
|
||||||
Header.headerToggler.firstElementChild.checked = hide;
|
Header.headerToggler.firstElementChild.checked = hide;
|
||||||
|
|||||||
@ -5137,7 +5137,7 @@
|
|||||||
return section.scrollTop = 0;
|
return section.scrollTop = 0;
|
||||||
},
|
},
|
||||||
main: function(section) {
|
main: function(section) {
|
||||||
var arr, button, description, div, fs, hiddenNum, input, inputs, items, key, obj, unhide, _ref;
|
var arr, button, description, div, fs, hiddenNum, input, inputs, items, key, obj, _ref;
|
||||||
|
|
||||||
section.innerHTML = "<div class=imp-exp>\n <button class=export>Export Settings</button>\n <button class=import>Import Settings</button>\n <input type=file style='visibility:hidden'>\n</div>\n<p class=imp-exp-result></p>";
|
section.innerHTML = "<div class=imp-exp>\n <button class=export>Export Settings</button>\n <button class=import>Import Settings</button>\n <input type=file style='visibility:hidden'>\n</div>\n<p class=imp-exp-result></p>";
|
||||||
$.on($('.export', section), 'click', Settings["export"]);
|
$.on($('.export', section), 'click', Settings["export"]);
|
||||||
@ -5226,17 +5226,7 @@
|
|||||||
return $["delete"](['hiddenThreads', 'hiddenPosts']);
|
return $["delete"](['hiddenThreads', 'hiddenPosts']);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
$.after($('input[name="Stubs"]', section).parentNode.parentNode, div);
|
return $.after($('input[name="Stubs"]', section).parentNode.parentNode, div);
|
||||||
div = $.el('div', {
|
|
||||||
innerHTML: "<button>Reset Header</button><span class=description>: Unhide the navigation bar."
|
|
||||||
});
|
|
||||||
unhide = $('button', div);
|
|
||||||
$.on(unhide, 'click', function() {
|
|
||||||
return Header.setBarPosition.call({
|
|
||||||
textContent: "sticky top"
|
|
||||||
});
|
|
||||||
});
|
|
||||||
return $.after($('input[name="Check for Updates"]', section).parentNode.parentNode, div);
|
|
||||||
},
|
},
|
||||||
"export": function(now, data) {
|
"export": function(now, data) {
|
||||||
var a, db, p, _i, _len;
|
var a, db, p, _i, _len;
|
||||||
@ -6150,11 +6140,7 @@
|
|||||||
Header.setBarPosition.call({
|
Header.setBarPosition.call({
|
||||||
textContent: "" + Conf['Boards Navigation']
|
textContent: "" + Conf['Boards Navigation']
|
||||||
});
|
});
|
||||||
$.sync('Boards Navigation', function() {
|
$.sync('Boards Navigation', Header.changeBarPosition);
|
||||||
return Header.setBarPosition.call({
|
|
||||||
textContent: "" + Conf['Boards Navigation']
|
|
||||||
});
|
|
||||||
});
|
|
||||||
Header.setBarVisibility(Conf['Header auto-hide']);
|
Header.setBarVisibility(Conf['Header auto-hide']);
|
||||||
$.sync('Header auto-hide', Header.setBarVisibility);
|
$.sync('Header auto-hide', Header.setBarVisibility);
|
||||||
$.prepend(d.body, settings = $.id('navtopright'));
|
$.prepend(d.body, settings = $.id('navtopright'));
|
||||||
@ -6241,33 +6227,33 @@
|
|||||||
},
|
},
|
||||||
setBarPosition: function() {
|
setBarPosition: function() {
|
||||||
$.event('CloseMenu');
|
$.event('CloseMenu');
|
||||||
switch (this.textContent) {
|
Header.changeBarPosition(this.textContent);
|
||||||
|
Conf['Boards Navigation'] = this.textContent;
|
||||||
|
return $.set('Boards Navigation', this.textContent);
|
||||||
|
},
|
||||||
|
changeBarPosition: function(setting) {
|
||||||
|
switch (setting) {
|
||||||
case 'sticky top':
|
case 'sticky top':
|
||||||
$.addClass(doc, 'top');
|
$.addClass(doc, 'top');
|
||||||
$.addClass(doc, 'fixed');
|
$.addClass(doc, 'fixed');
|
||||||
$.rmClass(doc, 'bottom');
|
$.rmClass(doc, 'bottom');
|
||||||
$.rmClass(doc, 'hide');
|
return $.rmClass(doc, 'hide');
|
||||||
break;
|
|
||||||
case 'sticky bottom':
|
case 'sticky bottom':
|
||||||
$.rmClass(doc, 'top');
|
$.rmClass(doc, 'top');
|
||||||
$.addClass(doc, 'fixed');
|
$.addClass(doc, 'fixed');
|
||||||
$.addClass(doc, 'bottom');
|
$.addClass(doc, 'bottom');
|
||||||
$.rmClass(doc, 'hide');
|
return $.rmClass(doc, 'hide');
|
||||||
break;
|
|
||||||
case 'top':
|
case 'top':
|
||||||
$.addClass(doc, 'top');
|
$.addClass(doc, 'top');
|
||||||
$.rmClass(doc, 'fixed');
|
$.rmClass(doc, 'fixed');
|
||||||
$.rmClass(doc, 'bottom');
|
$.rmClass(doc, 'bottom');
|
||||||
$.rmClass(doc, 'hide');
|
return $.rmClass(doc, 'hide');
|
||||||
break;
|
|
||||||
case 'hide':
|
case 'hide':
|
||||||
$.rmClass(doc, 'top');
|
$.rmClass(doc, 'top');
|
||||||
$.rmClass(doc, 'fixed');
|
$.rmClass(doc, 'fixed');
|
||||||
$.rmClass(doc, 'bottom');
|
$.rmClass(doc, 'bottom');
|
||||||
$.addClass(doc, 'hide');
|
return $.addClass(doc, 'hide');
|
||||||
}
|
}
|
||||||
Conf['Boards Navigation'] = this.textContent;
|
|
||||||
return $.set('Boards Navigation', this.textContent);
|
|
||||||
},
|
},
|
||||||
setBarVisibility: function(hide) {
|
setBarVisibility: function(hide) {
|
||||||
Header.headerToggler.firstElementChild.checked = hide;
|
Header.headerToggler.firstElementChild.checked = hide;
|
||||||
|
|||||||
Binary file not shown.
BIN
builds/crx.crx
BIN
builds/crx.crx
Binary file not shown.
@ -5082,7 +5082,7 @@
|
|||||||
return section.scrollTop = 0;
|
return section.scrollTop = 0;
|
||||||
},
|
},
|
||||||
main: function(section) {
|
main: function(section) {
|
||||||
var arr, button, description, div, fs, hiddenNum, input, inputs, items, key, obj, unhide, _ref;
|
var arr, button, description, div, fs, hiddenNum, input, inputs, items, key, obj, _ref;
|
||||||
|
|
||||||
section.innerHTML = "<div class=imp-exp>\n <button class=export>Export Settings</button>\n <button class=import>Import Settings</button>\n <input type=file style='visibility:hidden'>\n</div>\n<p class=imp-exp-result></p>";
|
section.innerHTML = "<div class=imp-exp>\n <button class=export>Export Settings</button>\n <button class=import>Import Settings</button>\n <input type=file style='visibility:hidden'>\n</div>\n<p class=imp-exp-result></p>";
|
||||||
$.on($('.export', section), 'click', Settings["export"]);
|
$.on($('.export', section), 'click', Settings["export"]);
|
||||||
@ -5171,17 +5171,7 @@
|
|||||||
return $["delete"](['hiddenThreads', 'hiddenPosts']);
|
return $["delete"](['hiddenThreads', 'hiddenPosts']);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
$.after($('input[name="Stubs"]', section).parentNode.parentNode, div);
|
return $.after($('input[name="Stubs"]', section).parentNode.parentNode, div);
|
||||||
div = $.el('div', {
|
|
||||||
innerHTML: "<button>Reset Header</button><span class=description>: Unhide the navigation bar."
|
|
||||||
});
|
|
||||||
unhide = $('button', div);
|
|
||||||
$.on(unhide, 'click', function() {
|
|
||||||
return Header.setBarPosition.call({
|
|
||||||
textContent: "sticky top"
|
|
||||||
});
|
|
||||||
});
|
|
||||||
return $.after($('input[name="Check for Updates"]', section).parentNode.parentNode, div);
|
|
||||||
},
|
},
|
||||||
"export": function(now, data) {
|
"export": function(now, data) {
|
||||||
var a, db, p, _i, _len;
|
var a, db, p, _i, _len;
|
||||||
@ -6095,11 +6085,7 @@
|
|||||||
Header.setBarPosition.call({
|
Header.setBarPosition.call({
|
||||||
textContent: "" + Conf['Boards Navigation']
|
textContent: "" + Conf['Boards Navigation']
|
||||||
});
|
});
|
||||||
$.sync('Boards Navigation', function() {
|
$.sync('Boards Navigation', Header.changeBarPosition);
|
||||||
return Header.setBarPosition.call({
|
|
||||||
textContent: "" + Conf['Boards Navigation']
|
|
||||||
});
|
|
||||||
});
|
|
||||||
Header.setBarVisibility(Conf['Header auto-hide']);
|
Header.setBarVisibility(Conf['Header auto-hide']);
|
||||||
$.sync('Header auto-hide', Header.setBarVisibility);
|
$.sync('Header auto-hide', Header.setBarVisibility);
|
||||||
$.prepend(d.body, settings = $.id('navtopright'));
|
$.prepend(d.body, settings = $.id('navtopright'));
|
||||||
@ -6186,33 +6172,33 @@
|
|||||||
},
|
},
|
||||||
setBarPosition: function() {
|
setBarPosition: function() {
|
||||||
$.event('CloseMenu');
|
$.event('CloseMenu');
|
||||||
switch (this.textContent) {
|
Header.changeBarPosition(this.textContent);
|
||||||
|
Conf['Boards Navigation'] = this.textContent;
|
||||||
|
return $.set('Boards Navigation', this.textContent);
|
||||||
|
},
|
||||||
|
changeBarPosition: function(setting) {
|
||||||
|
switch (setting) {
|
||||||
case 'sticky top':
|
case 'sticky top':
|
||||||
$.addClass(doc, 'top');
|
$.addClass(doc, 'top');
|
||||||
$.addClass(doc, 'fixed');
|
$.addClass(doc, 'fixed');
|
||||||
$.rmClass(doc, 'bottom');
|
$.rmClass(doc, 'bottom');
|
||||||
$.rmClass(doc, 'hide');
|
return $.rmClass(doc, 'hide');
|
||||||
break;
|
|
||||||
case 'sticky bottom':
|
case 'sticky bottom':
|
||||||
$.rmClass(doc, 'top');
|
$.rmClass(doc, 'top');
|
||||||
$.addClass(doc, 'fixed');
|
$.addClass(doc, 'fixed');
|
||||||
$.addClass(doc, 'bottom');
|
$.addClass(doc, 'bottom');
|
||||||
$.rmClass(doc, 'hide');
|
return $.rmClass(doc, 'hide');
|
||||||
break;
|
|
||||||
case 'top':
|
case 'top':
|
||||||
$.addClass(doc, 'top');
|
$.addClass(doc, 'top');
|
||||||
$.rmClass(doc, 'fixed');
|
$.rmClass(doc, 'fixed');
|
||||||
$.rmClass(doc, 'bottom');
|
$.rmClass(doc, 'bottom');
|
||||||
$.rmClass(doc, 'hide');
|
return $.rmClass(doc, 'hide');
|
||||||
break;
|
|
||||||
case 'hide':
|
case 'hide':
|
||||||
$.rmClass(doc, 'top');
|
$.rmClass(doc, 'top');
|
||||||
$.rmClass(doc, 'fixed');
|
$.rmClass(doc, 'fixed');
|
||||||
$.rmClass(doc, 'bottom');
|
$.rmClass(doc, 'bottom');
|
||||||
$.addClass(doc, 'hide');
|
return $.addClass(doc, 'hide');
|
||||||
}
|
}
|
||||||
Conf['Boards Navigation'] = this.textContent;
|
|
||||||
return $.set('Boards Navigation', this.textContent);
|
|
||||||
},
|
},
|
||||||
setBarVisibility: function(hide) {
|
setBarVisibility: function(hide) {
|
||||||
Header.headerToggler.firstElementChild.checked = hide;
|
Header.headerToggler.firstElementChild.checked = hide;
|
||||||
|
|||||||
@ -77,8 +77,7 @@ Header =
|
|||||||
id: 'custom-board-list'
|
id: 'custom-board-list'
|
||||||
|
|
||||||
Header.setBarPosition.call textContent: "#{Conf['Boards Navigation']}"
|
Header.setBarPosition.call textContent: "#{Conf['Boards Navigation']}"
|
||||||
$.sync 'Boards Navigation', ->
|
$.sync 'Boards Navigation', Header.changeBarPosition
|
||||||
Header.setBarPosition.call textContent: "#{Conf['Boards Navigation']}"
|
|
||||||
|
|
||||||
Header.setBarVisibility Conf['Header auto-hide']
|
Header.setBarVisibility Conf['Header auto-hide']
|
||||||
$.sync 'Header auto-hide', Header.setBarVisibility
|
$.sync 'Header auto-hide', Header.setBarVisibility
|
||||||
@ -151,7 +150,13 @@ Header =
|
|||||||
setBarPosition: ->
|
setBarPosition: ->
|
||||||
$.event 'CloseMenu'
|
$.event 'CloseMenu'
|
||||||
|
|
||||||
switch @textContent
|
Header.changeBarPosition @textContent
|
||||||
|
|
||||||
|
Conf['Boards Navigation'] = @textContent
|
||||||
|
$.set 'Boards Navigation', @textContent
|
||||||
|
|
||||||
|
changeBarPosition: (setting) ->
|
||||||
|
switch setting
|
||||||
when 'sticky top'
|
when 'sticky top'
|
||||||
$.addClass doc, 'top'
|
$.addClass doc, 'top'
|
||||||
$.addClass doc, 'fixed'
|
$.addClass doc, 'fixed'
|
||||||
@ -173,9 +178,6 @@ Header =
|
|||||||
$.rmClass doc, 'bottom'
|
$.rmClass doc, 'bottom'
|
||||||
$.addClass doc, 'hide'
|
$.addClass doc, 'hide'
|
||||||
|
|
||||||
Conf['Boards Navigation'] = @textContent
|
|
||||||
$.set 'Boards Navigation', @textContent
|
|
||||||
|
|
||||||
setBarVisibility: (hide) ->
|
setBarVisibility: (hide) ->
|
||||||
Header.headerToggler.firstElementChild.checked = hide
|
Header.headerToggler.firstElementChild.checked = hide
|
||||||
(if hide then $.addClass else $.rmClass) Header.nav, 'autohide'
|
(if hide then $.addClass else $.rmClass) Header.nav, 'autohide'
|
||||||
|
|||||||
@ -188,13 +188,6 @@ Settings =
|
|||||||
$.delete ['hiddenThreads', 'hiddenPosts']
|
$.delete ['hiddenThreads', 'hiddenPosts']
|
||||||
$.after $('input[name="Stubs"]', section).parentNode.parentNode, div
|
$.after $('input[name="Stubs"]', section).parentNode.parentNode, div
|
||||||
|
|
||||||
div = $.el 'div',
|
|
||||||
innerHTML: "<button>Reset Header</button><span class=description>: Unhide the navigation bar."
|
|
||||||
unhide = $ 'button', div
|
|
||||||
$.on unhide, 'click', ->
|
|
||||||
Header.setBarPosition.call textContent: "sticky top"
|
|
||||||
$.after $('input[name="Check for Updates"]', section).parentNode.parentNode, div
|
|
||||||
|
|
||||||
export: (now, data) ->
|
export: (now, data) ->
|
||||||
unless typeof now is 'number'
|
unless typeof now is 'number'
|
||||||
now = Date.now()
|
now = Date.now()
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user