From eafd4c28bdaf2f7980177a8b7db1ac701ad71468 Mon Sep 17 00:00:00 2001 From: zombieFox Date: Wed, 22 Apr 2020 18:43:25 +0100 Subject: [PATCH] [bug] fix saved custom theme controls tab index when not in edit mode --- package-lock.json | 2 +- package.json | 2 +- src/js/control.js | 11 +++++++++++ src/js/theme.js | 6 +++--- src/js/version.js | 2 +- src/manifest.json | 2 +- 6 files changed, 18 insertions(+), 7 deletions(-) diff --git a/package-lock.json b/package-lock.json index 42a325b0..3e6e8dc6 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "nightTab", - "version": "5.21.0", + "version": "5.21.1", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index f0aa0345..af015461 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "nightTab", - "version": "5.21.0", + "version": "5.21.1", "description": "A neutral new tab page accented with a chosen colour. Customise the layout, style, background and bookmarks in nightTab.", "main": "index.js", "scripts": { diff --git a/src/js/control.js b/src/js/control.js index cf66091d..b0015336 100644 --- a/src/js/control.js +++ b/src/js/control.js @@ -18,6 +18,7 @@ var control = (function() { type: "button", func: function() { menu.open(); + theme.render.custom.tabIndex(); }, }, { element: ".control-add-link", @@ -183,60 +184,70 @@ var control = (function() { type: "button", func: function() { menu.nav("layout"); + theme.render.custom.tabIndex(); } }, { element: ".control-menu-header", type: "button", func: function() { menu.nav("header"); + theme.render.custom.tabIndex(); } }, { element: ".control-menu-groups", type: "button", func: function() { menu.nav("groups"); + theme.render.custom.tabIndex(); } }, { element: ".control-menu-bookmarks", type: "button", func: function() { menu.nav("bookmarks"); + theme.render.custom.tabIndex(); } }, { element: ".control-menu-theme", type: "button", func: function() { menu.nav("theme"); + theme.render.custom.tabIndex(); } }, { element: ".control-menu-background", type: "button", func: function() { menu.nav("background"); + theme.render.custom.tabIndex(); } }, { element: ".control-menu-data", type: "button", func: function() { menu.nav("data"); + theme.render.custom.tabIndex(); } }, { element: ".control-menu-coffee", type: "button", func: function() { menu.nav("coffee"); + theme.render.custom.tabIndex(); } }, { element: ".control-menu-nighttab", type: "button", func: function() { menu.nav("nighttab"); + theme.render.custom.tabIndex(); } }, { element: ".control-menu-close", type: "button", func: function() { menu.close(); + theme.render.custom.tabIndex(); } }] }, diff --git a/src/js/theme.js b/src/js/theme.js index 70f4ca1a..f028e01a 100644 --- a/src/js/theme.js +++ b/src/js/theme.js @@ -2275,9 +2275,9 @@ var theme = (function() { var themeCustomButton = helper.node("button|class:theme-custom-button button button-block button-ring,tabindex:-1"); var themeCustomPreview = helper.node("span|class:theme-custom-preview"); var themeCustomControl = helper.node("div|class:theme-custom-control"); - var themeCustomEdit = helper.node("button|class:theme-custom-control-item theme-custom-control-item-remove button button-small,tabindex:-2"); + var themeCustomEdit = helper.node("button|class:theme-custom-control-item theme-custom-control-item-remove button button-small,tabindex:-1"); var themeCustomEditIcon = helper.node("spa|class:button-icon icon-edit"); - var themeCustomRemove = helper.node("button|class:theme-custom-control-item theme-custom-control-item-remove button button-small,tabindex:-2"); + var themeCustomRemove = helper.node("button|class:theme-custom-control-item theme-custom-control-item-remove button button-small,tabindex:-1"); var themeCustomRemoveIcon = helper.node("spa|class:button-icon icon-close"); var shadeSteps = 4; var rgb = arrayItem.color.rgb; @@ -2578,7 +2578,7 @@ var theme = (function() { }); } else { helper.eA(".theme-custom-control-item").forEach(function(arrayItem, index) { - arrayItem.tabIndex = -2; + arrayItem.tabIndex = -1; }); }; }, diff --git a/src/js/version.js b/src/js/version.js index 1836c552..6f441e95 100644 --- a/src/js/version.js +++ b/src/js/version.js @@ -1,6 +1,6 @@ var version = (function() { - var current = "5.21.0"; + var current = "5.21.1"; var name = "Zonked Tarsier"; diff --git a/src/manifest.json b/src/manifest.json index a07211f8..e8f4b18f 100644 --- a/src/manifest.json +++ b/src/manifest.json @@ -2,7 +2,7 @@ "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.", - "version": "5.21.0", + "version": "5.21.1", "manifest_version": 2, "chrome_url_overrides": { "newtab": "index.html"