diff --git a/src/js/control.js b/src/js/control.js index bd2be3d2..65c7566f 100644 --- a/src/js/control.js +++ b/src/js/control.js @@ -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"), diff --git a/src/js/keyboard.js b/src/js/keyboard.js index 277502a7..869a00d9 100644 --- a/src/js/keyboard.js +++ b/src/js/keyboard.js @@ -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); diff --git a/src/js/link.js b/src/js/link.js index cbfb6d3f..6889ab5b 100644 --- a/src/js/link.js +++ b/src/js/link.js @@ -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 }; diff --git a/src/js/search.js b/src/js/search.js index f4964237..e72e99b8 100644 --- a/src/js/search.js +++ b/src/js/search.js @@ -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); }; diff --git a/src/js/theme.js b/src/js/theme.js index 850374ab..04a94259 100644 --- a/src/js/theme.js +++ b/src/js/theme.js @@ -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() { diff --git a/src/js/version.js b/src/js/version.js index 78494e0a..80019aef 100644 --- a/src/js/version.js +++ b/src/js/version.js @@ -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("."); diff --git a/src/manifest.json b/src/manifest.json index 73d33ee5..87322071 100644 --- a/src/manifest.json +++ b/src/manifest.json @@ -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"