[bug] disable menu tabbing when closed

This commit is contained in:
zombieFox 2019-07-04 00:22:34 +01:00
parent a8ddae2c53
commit 46bccd849a
3 changed files with 35 additions and 6 deletions

View File

@ -44,7 +44,8 @@ var menu = (function() {
path: "menu", path: "menu",
newValue: false newValue: false
}); });
render(); render.menu();
render.tabindex();
}; };
var open = function() { var open = function() {
@ -54,7 +55,8 @@ var menu = (function() {
path: "menu", path: "menu",
newValue: true newValue: true
}); });
render(); render.menu();
render.tabindex();
}; };
var toggle = function() { var toggle = function() {
@ -72,10 +74,20 @@ var menu = (function() {
newValue: true newValue: true
}); });
}; };
render(); render.menu();
render.tabindex();
}; };
var render = function() { var render = {
tabindex: function() {
renderTabindex();
},
menu: function() {
renderMenu();
}
};
var renderMenu = function() {
var html = helper.e("html"); var html = helper.e("html");
if (state.get().menu) { if (state.get().menu) {
helper.addClass(html, "is-menu-open"); helper.addClass(html, "is-menu-open");
@ -91,6 +103,23 @@ var menu = (function() {
}; };
}; };
var renderTabindex = function() {
var menu = helper.e(".menu");
if (state.get().menu) {
menu.tabIndex = 1;
menu.querySelectorAll("[tabindex]").forEach(function(arrayItem, index) {
arrayItem.tabIndex = 1;
console.log(arrayItem);
});
} else {
menu.tabIndex = -1;
menu.querySelectorAll("[tabindex]").forEach(function(arrayItem, index) {
arrayItem.tabIndex = -1;
console.log(arrayItem);
});
};
};
var init = function() { var init = function() {
_bind(); _bind();
close(); close();

View File

@ -1,6 +1,6 @@
var version = (function() { var version = (function() {
var current = "3.30.7"; var current = "3.30.8";
var compare = function(a, b) { var compare = function(a, b) {
var pa = a.split("."); var pa = a.split(".");

View File

@ -2,7 +2,7 @@
"name": "nightTab", "name": "nightTab",
"short_name": "nightTab", "short_name": "nightTab",
"description": "A neutral new tab page accented with a chosen colour. Customise the layout, style, background and bookmarks in nightTab.", "description": "A neutral new tab page accented with a chosen colour. Customise the layout, style, background and bookmarks in nightTab.",
"version": "3.30.7", "version": "3.30.8",
"manifest_version": 2, "manifest_version": 2,
"chrome_url_overrides": { "chrome_url_overrides": {
"newtab": "index.html" "newtab": "index.html"