[refactor] improve link render

This commit is contained in:
zombieFox 2019-07-15 23:46:32 +01:00
parent 41ee9dee86
commit cffa73c1fa
9 changed files with 473 additions and 475 deletions

View File

@ -75,7 +75,7 @@
<div class="form-group nested-button mb-0">
<div class="input-wrap input-button input-hide py-0">
<input id="control-link-edit" class="control-link-edit" type="checkbox" tabindex="1">
<label for="control-link-edit" class=" mb-0">Edit</label>
<label for="control-link-edit" class="mb-0">Edit</label>
</div>
<button class="control-link-add button" tabindex="1">
<span class="button-text">Add</span>

View File

@ -205,7 +205,7 @@ var autoSuggest = (function() {
helper.addClass(icon, "fab");
};
anchor.addEventListener("click", function() {
link.autoSuggestIconAction(arrayItem);
link.render.autoSuggestIconAction(arrayItem);
}, false);
var text = helper.node("span:" + arrayItem.label + "|class:auto-suggest-icon-text");
anchor.appendChild(icon);

View File

@ -11,7 +11,7 @@ var control = (function() {
element: helper.e(".control-link-add"),
type: "button",
func: function() {
link.add();
link.render.add();
}
}, {
element: helper.e(".control-link-edit"),
@ -26,7 +26,7 @@ var control = (function() {
type: "color",
func: function() {
theme.render.accent.color();
link.clear();
link.render.clear();
link.render.item.all();
sortable(".link-area");
}
@ -1875,7 +1875,7 @@ var control = (function() {
path: "link.item.order",
type: "radio",
func: function() {
link.clear();
link.render.clear();
link.render.item.all();
sortable(".link-area");
}
@ -1884,7 +1884,7 @@ var control = (function() {
path: "link.item.order",
type: "radio",
func: function() {
link.clear();
link.render.clear();
link.render.item.all();
sortable(".link-area");
}
@ -1923,7 +1923,7 @@ var control = (function() {
path: "link.newTab",
type: "checkbox",
func: function() {
link.clear();
link.render.clear();
link.render.item.all();
sortable(".link-area");
}
@ -1946,7 +1946,7 @@ var control = (function() {
type: "button",
func: function() {
bookmarks.sort("letter");
link.clear();
link.render.clear();
link.render.item.all();
sortable(".link-area");
}
@ -1955,7 +1955,7 @@ var control = (function() {
type: "button",
func: function() {
bookmarks.sort("icon");
link.clear();
link.render.clear();
link.render.item.all();
sortable(".link-area");
}
@ -1964,7 +1964,7 @@ var control = (function() {
type: "button",
func: function() {
bookmarks.sort("name");
link.clear();
link.render.clear();
link.render.item.all();
sortable(".link-area");
}
@ -1972,8 +1972,8 @@ var control = (function() {
element: helper.e(".control-link-accent-clear"),
type: "button",
func: function() {
link.accent.clear();
link.clear();
link.mod.accent.clear();
link.render.clear();
link.render.item.all();
sortable(".link-area");
}
@ -1981,8 +1981,8 @@ var control = (function() {
element: helper.e(".control-link-accent-set"),
type: "button",
func: function() {
link.accent.set();
link.clear();
link.mod.accent.rainbow();
link.render.clear();
link.render.item.all();
sortable(".link-area");
}
@ -2065,7 +2065,7 @@ var control = (function() {
func: function() {
theme.render.accent.random();
theme.render.accent.color();
link.clear();
link.render.clear();
link.render.item.all();
sortable(".link-area");
}
@ -2798,7 +2798,6 @@ var control = (function() {
if (bookmarks.get().length > 0) {
disable.input(".control-link-edit", false);
} else {
disable.input(".control-link-edit", true);
disable.input(".control-link-edit", false);
};
};

View File

@ -147,6 +147,11 @@ var header = (function() {
}
};
action[state.get().header.button.style]();
},
edit: function() {
if (!state.get().link.edit) {
helper.e(".control-link-edit").checked = false;
};
}
};

View File

@ -36,7 +36,7 @@ var keyboard = (function() {
if (event.ctrlKey && event.altKey && event.keyCode == 65) {
if (state.get().link.show) {
menu.close();
link.add();
link.render.add();
};
};
}, false);
@ -97,7 +97,7 @@ var keyboard = (function() {
if (state.get().theme.accent.random.active && event.ctrlKey && event.altKey && event.keyCode == 82) {
theme.render.accent.random();
theme.render.accent.color();
link.clear();
link.render.clear();
link.render.item.all();
sortable(".link-area");
data.save();

File diff suppressed because it is too large Load Diff

View File

@ -7,7 +7,7 @@ var search = (function() {
searchInput.addEventListener("input", function() {
mod.searching.set();
render.clear.button();
link.clear();
link.render.clear();
link.render.item.all();
sortable(".link-area");
}, false);
@ -19,7 +19,7 @@ var search = (function() {
render.clear.input();
mod.searching.set();
render.clear.button();
link.clear();
link.render.clear();
link.render.item.all();
sortable(".link-area");
}, false);

View File

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

View File

@ -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": "3.40.0",
"version": "3.41.0",
"manifest_version": 2,
"chrome_url_overrides": {
"newtab": "index.html"