Skip to content

Commit 46bccd8

Browse files
committed
[bug] disable menu tabbing when closed
1 parent a8ddae2 commit 46bccd8

File tree

3 files changed

+35
-6
lines changed

3 files changed

+35
-6
lines changed

‎src/js/menu.js‎

Lines changed: 33 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,8 @@ var menu = (function(){
4444
path: "menu",
4545
newValue: false
4646
});
47-
render();
47+
render.menu();
48+
render.tabindex();
4849
};
4950

5051
varopen=function(){
@@ -54,7 +55,8 @@ var menu = (function(){
5455
path: "menu",
5556
newValue: true
5657
});
57-
render();
58+
render.menu();
59+
render.tabindex();
5860
};
5961

6062
vartoggle=function(){
@@ -72,10 +74,20 @@ var menu = (function(){
7274
newValue: true
7375
});
7476
};
75-
render();
77+
render.menu();
78+
render.tabindex();
7679
};
7780

78-
varrender=function(){
81+
varrender={
82+
tabindex: function(){
83+
renderTabindex();
84+
},
85+
menu: function(){
86+
renderMenu();
87+
}
88+
};
89+
90+
varrenderMenu=function(){
7991
varhtml=helper.e("html");
8092
if(state.get().menu){
8193
helper.addClass(html,"is-menu-open");
@@ -91,6 +103,23 @@ var menu = (function(){
91103
};
92104
};
93105

106+
varrenderTabindex=function(){
107+
varmenu=helper.e(".menu");
108+
if(state.get().menu){
109+
menu.tabIndex=1;
110+
menu.querySelectorAll("[tabindex]").forEach(function(arrayItem,index){
111+
arrayItem.tabIndex=1;
112+
console.log(arrayItem);
113+
});
114+
}else{
115+
menu.tabIndex=-1;
116+
menu.querySelectorAll("[tabindex]").forEach(function(arrayItem,index){
117+
arrayItem.tabIndex=-1;
118+
console.log(arrayItem);
119+
});
120+
};
121+
};
122+
94123
varinit=function(){
95124
_bind();
96125
close();

‎src/js/version.js‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
varversion=(function(){
22

3-
varcurrent="3.30.7";
3+
varcurrent="3.30.8";
44

55
varcompare=function(a,b){
66
varpa=a.split(".");

‎src/manifest.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "nightTab",
33
"short_name": "nightTab",
44
"description": "A neutral new tab page accented with a chosen colour. Customise the layout, style, background and bookmarks in nightTab.",
5-
"version": "3.30.7",
5+
"version": "3.30.8",
66
"manifest_version": 2,
77
"chrome_url_overrides":{
88
"newtab": "index.html"

0 commit comments

Comments
(0)