[refactor] improve link module

This commit is contained in:
Kuldeep M 2019-07-19 00:32:47 +01:00
parent ee1f0d4508
commit 2fa1fec109
7 changed files with 22 additions and 41 deletions

View File

@ -74,6 +74,7 @@ var control = (function() {
type: "color",
func: function() {
theme.accent();
// link.items();
}
}, {
element: helper.e(".control-layout-width"),
@ -1920,18 +1921,14 @@ var control = (function() {
path: "link.item.order",
type: "radio",
func: function() {
link.render.clear();
link.render.item.all();
sortable(".link-area");
link.items();
}
}, {
element: helper.e(".control-link-item-order-namedisplay"),
path: "link.item.order",
type: "radio",
func: function() {
link.render.clear();
link.render.item.all();
sortable(".link-area");
link.items();
}
}, {
element: helper.e(".control-link-item-url-show"),
@ -1968,9 +1965,7 @@ var control = (function() {
path: "link.newTab",
type: "checkbox",
func: function() {
link.render.clear();
link.render.item.all();
sortable(".link-area");
link.items();
}
}, {
element: helper.e(".control-link-style-block"),
@ -1991,45 +1986,35 @@ var control = (function() {
type: "button",
func: function() {
bookmarks.sort("letter");
link.render.clear();
link.render.item.all();
sortable(".link-area");
link.items();
}
}, {
element: helper.e(".control-link-sort-icon"),
type: "button",
func: function() {
bookmarks.sort("icon");
link.render.clear();
link.render.item.all();
sortable(".link-area");
link.items();
}
}, {
element: helper.e(".control-link-sort-name"),
type: "button",
func: function() {
bookmarks.sort("name");
link.render.clear();
link.render.item.all();
sortable(".link-area");
link.items();
}
}, {
element: helper.e(".control-link-accent-clear"),
type: "button",
func: function() {
link.mod.accent.clear();
link.render.clear();
link.render.item.all();
sortable(".link-area");
link.items();
}
}, {
element: helper.e(".control-link-accent-set"),
type: "button",
func: function() {
link.mod.accent.rainbow();
link.render.clear();
link.render.item.all();
sortable(".link-area");
link.items();
}
}, {
element: helper.e(".control-theme-style-dark"),
@ -2110,9 +2095,7 @@ var control = (function() {
func: function() {
theme.render.accent.random();
theme.render.accent.color();
link.render.clear();
link.render.item.all();
sortable(".link-area");
link.items();
}
}, {
element: helper.e(".control-background-image-show"),

View File

@ -96,9 +96,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.render.clear();
link.render.item.all();
sortable(".link-area");
link.items();
data.save();
};
}, false);

View File

@ -784,6 +784,12 @@ var link = (function() {
render.item.tabindex();
};
var items = function() {
render.clear();
render.item.all();
sortable(".link-area");
};
var init = function() {
mod.add.close();
render.area.width();
@ -803,6 +809,7 @@ var link = (function() {
render: render,
add: add,
edit: edit,
items: items,
tabindex: tabindex
};

View File

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

View File

@ -111,9 +111,6 @@ var theme = (function() {
var accent = function() {
theme.render.accent.color();
link.render.clear();
link.render.item.all();
sortable(".link-area");
};
var init = function() {

View File

@ -1,6 +1,6 @@
var version = (function() {
var current = "3.53.0";
var current = "3.54.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.53.0",
"version": "3.54.0",
"manifest_version": 2,
"chrome_url_overrides": {
"newtab": "index.html"