Skip to content

Commit cffa73c

Browse files
committed
[refactor] improve link render
1 parent 41ee9de commit cffa73c

File tree

9 files changed

+473
-475
lines changed

9 files changed

+473
-475
lines changed

‎src/index.html‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@
7575
<divclass="form-group nested-button mb-0">
7676
<divclass="input-wrap input-button input-hide py-0">
7777
<inputid="control-link-edit" class="control-link-edit" type="checkbox" tabindex="1">
78-
<labelfor="control-link-edit" class="mb-0">Edit</label>
78+
<labelfor="control-link-edit" class="mb-0">Edit</label>
7979
</div>
8080
<buttonclass="control-link-add button" tabindex="1">
8181
<spanclass="button-text">Add</span>

‎src/js/auto-suggest.js‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ var autoSuggest = (function(){
205205
helper.addClass(icon,"fab");
206206
};
207207
anchor.addEventListener("click",function(){
208-
link.autoSuggestIconAction(arrayItem);
208+
link.render.autoSuggestIconAction(arrayItem);
209209
},false);
210210
vartext=helper.node("span:"+arrayItem.label+"|class:auto-suggest-icon-text");
211211
anchor.appendChild(icon);

‎src/js/control.js‎

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ var control = (function(){
1111
element: helper.e(".control-link-add"),
1212
type: "button",
1313
func: function(){
14-
link.add();
14+
link.render.add();
1515
}
1616
},{
1717
element: helper.e(".control-link-edit"),
@@ -26,7 +26,7 @@ var control = (function(){
2626
type: "color",
2727
func: function(){
2828
theme.render.accent.color();
29-
link.clear();
29+
link.render.clear();
3030
link.render.item.all();
3131
sortable(".link-area");
3232
}
@@ -1875,7 +1875,7 @@ var control = (function(){
18751875
path: "link.item.order",
18761876
type: "radio",
18771877
func: function(){
1878-
link.clear();
1878+
link.render.clear();
18791879
link.render.item.all();
18801880
sortable(".link-area");
18811881
}
@@ -1884,7 +1884,7 @@ var control = (function(){
18841884
path: "link.item.order",
18851885
type: "radio",
18861886
func: function(){
1887-
link.clear();
1887+
link.render.clear();
18881888
link.render.item.all();
18891889
sortable(".link-area");
18901890
}
@@ -1923,7 +1923,7 @@ var control = (function(){
19231923
path: "link.newTab",
19241924
type: "checkbox",
19251925
func: function(){
1926-
link.clear();
1926+
link.render.clear();
19271927
link.render.item.all();
19281928
sortable(".link-area");
19291929
}
@@ -1946,7 +1946,7 @@ var control = (function(){
19461946
type: "button",
19471947
func: function(){
19481948
bookmarks.sort("letter");
1949-
link.clear();
1949+
link.render.clear();
19501950
link.render.item.all();
19511951
sortable(".link-area");
19521952
}
@@ -1955,7 +1955,7 @@ var control = (function(){
19551955
type: "button",
19561956
func: function(){
19571957
bookmarks.sort("icon");
1958-
link.clear();
1958+
link.render.clear();
19591959
link.render.item.all();
19601960
sortable(".link-area");
19611961
}
@@ -1964,25 +1964,25 @@ var control = (function(){
19641964
type: "button",
19651965
func: function(){
19661966
bookmarks.sort("name");
1967-
link.clear();
1967+
link.render.clear();
19681968
link.render.item.all();
19691969
sortable(".link-area");
19701970
}
19711971
},{
19721972
element: helper.e(".control-link-accent-clear"),
19731973
type: "button",
19741974
func: function(){
1975-
link.accent.clear();
1976-
link.clear();
1975+
link.mod.accent.clear();
1976+
link.render.clear();
19771977
link.render.item.all();
19781978
sortable(".link-area");
19791979
}
19801980
},{
19811981
element: helper.e(".control-link-accent-set"),
19821982
type: "button",
19831983
func: function(){
1984-
link.accent.set();
1985-
link.clear();
1984+
link.mod.accent.rainbow();
1985+
link.render.clear();
19861986
link.render.item.all();
19871987
sortable(".link-area");
19881988
}
@@ -2065,7 +2065,7 @@ var control = (function(){
20652065
func: function(){
20662066
theme.render.accent.random();
20672067
theme.render.accent.color();
2068-
link.clear();
2068+
link.render.clear();
20692069
link.render.item.all();
20702070
sortable(".link-area");
20712071
}
@@ -2798,7 +2798,6 @@ var control = (function(){
27982798
if(bookmarks.get().length>0){
27992799
disable.input(".control-link-edit",false);
28002800
}else{
2801-
disable.input(".control-link-edit",true);
28022801
disable.input(".control-link-edit",false);
28032802
};
28042803
};

‎src/js/header.js‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,11 @@ var header = (function(){
147147
}
148148
};
149149
action[state.get().header.button.style]();
150+
},
151+
edit: function(){
152+
if(!state.get().link.edit){
153+
helper.e(".control-link-edit").checked=false;
154+
};
150155
}
151156
};
152157

‎src/js/keyboard.js‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ var keyboard = (function(){
3636
if(event.ctrlKey&&event.altKey&&event.keyCode==65){
3737
if(state.get().link.show){
3838
menu.close();
39-
link.add();
39+
link.render.add();
4040
};
4141
};
4242
},false);
@@ -97,7 +97,7 @@ var keyboard = (function(){
9797
if(state.get().theme.accent.random.active&&event.ctrlKey&&event.altKey&&event.keyCode==82){
9898
theme.render.accent.random();
9999
theme.render.accent.color();
100-
link.clear();
100+
link.render.clear();
101101
link.render.item.all();
102102
sortable(".link-area");
103103
data.save();

0 commit comments

Comments
(0)