Skip to content

Commit a041b27

Browse files
committed
[refactor] all module exposed functions
1 parent 648e4f9 commit a041b27

File tree

13 files changed

+377
-272
lines changed

13 files changed

+377
-272
lines changed

‎src/js/control.js‎

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,43 +10,43 @@ var control = (function(){
1010
element: helper.e(".control-menu-layout"),
1111
type: "button",
1212
func: function(){
13-
menu.render.tab(this.element,helper.e(".menu-content-area-layout"));
13+
menu.nav(this.element,helper.e(".menu-content-area-layout"));
1414
}
1515
},{
1616
element: helper.e(".control-menu-header"),
1717
type: "button",
1818
func: function(){
19-
menu.render.tab(this.element,helper.e(".menu-content-area-header"));
19+
menu.nav(this.element,helper.e(".menu-content-area-header"));
2020
}
2121
},{
2222
element: helper.e(".control-menu-bookmarks"),
2323
type: "button",
2424
func: function(){
25-
menu.render.tab(this.element,helper.e(".menu-content-area-bookmarks"));
25+
menu.nav(this.element,helper.e(".menu-content-area-bookmarks"));
2626
}
2727
},{
2828
element: helper.e(".control-menu-theme"),
2929
type: "button",
3030
func: function(){
31-
menu.render.tab(this.element,helper.e(".menu-content-area-theme"));
31+
menu.nav(this.element,helper.e(".menu-content-area-theme"));
3232
}
3333
},{
3434
element: helper.e(".control-menu-background"),
3535
type: "button",
3636
func: function(){
37-
menu.render.tab(this.element,helper.e(".menu-content-area-background"));
37+
menu.nav(this.element,helper.e(".menu-content-area-background"));
3838
}
3939
},{
4040
element: helper.e(".control-menu-data"),
4141
type: "button",
4242
func: function(){
43-
menu.render.tab(this.element,helper.e(".menu-content-area-data"));
43+
menu.nav(this.element,helper.e(".menu-content-area-data"));
4444
}
4545
},{
4646
element: helper.e(".control-menu-nightTab"),
4747
type: "button",
4848
func: function(){
49-
menu.render.tab(this.element,helper.e(".menu-content-area-nightTab"));
49+
menu.nav(this.element,helper.e(".menu-content-area-nightTab"));
5050
}
5151
},{
5252
element: helper.e(".control-menu-close"),
@@ -65,8 +65,8 @@ var control = (function(){
6565
path: "link.edit",
6666
type: "checkbox",
6767
func: function(){
68+
link.tabindex();
6869
render();
69-
link.render.tabindex();
7070
}
7171
},{
7272
element: helper.e(".control-theme-accent-current"),

‎src/js/data.js‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ var data = (function(){
9595
varpara2=helper.node("p:This can not be undone.");
9696
clearContent.appendChild(para1);
9797
clearContent.appendChild(para2);
98-
modal.render.make({
98+
modal.open({
9999
heading: "Clear all nightTab data?",
100100
content: clearContent,
101101
successAction: function(){

‎src/js/init.js‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,5 @@ background.init();
1717
search.init();
1818
header.init();
1919
modal.init();
20+
shade.init();
2021
version.init();

‎src/js/keyboard.js‎

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,14 @@ var keyboard = (function(){
1010
edge.render.clear();
1111
}elseif(state.get().menu){
1212
menu.close();
13+
shade.close();
14+
pagelock.unlock();
1315
}elseif(state.get().autoSuggest){
1416
autoSuggest.destroy();
1517
}elseif(state.get().modal){
16-
modal.render.clear();
17-
shade.destroy();
18+
modal.close();
19+
shade.close();
20+
pagelock.unlock();
1821
}elseif(state.get().link.edit){
1922
helper.setObject({
2023
object: state.get(),
@@ -38,9 +41,15 @@ var keyboard = (function(){
3841
menu.close();
3942
};
4043
if(state.get().modal){
41-
modal.render.clear();
44+
modal.close();
4245
};
4346
link.add();
47+
shade.open({
48+
action: function(){
49+
modal.close();
50+
pagelock.unlock();
51+
}
52+
});
4453
};
4554
};
4655
},false);
@@ -63,7 +72,8 @@ var keyboard = (function(){
6372
// ctrl+alt+m
6473
if(event.ctrlKey&&event.altKey&&event.keyCode==77){
6574
if(state.get().modal){
66-
modal.render.clear();
75+
modal.close();
76+
shade.close();
6777
};
6878
menu.toggle();
6979
};
@@ -74,8 +84,8 @@ var keyboard = (function(){
7484
window.addEventListener("keydown",function(event){
7585
// ctrl+alt+e
7686
if(event.ctrlKey&&event.altKey&&event.keyCode==69){
77-
link.mod.edit.toggle();
78-
link.render.tabindex();
87+
link.edit();
88+
link.tabindex();
7989
control.update();
8090
control.render();
8191
data.save();

0 commit comments

Comments
(0)