[refactor] improve state module

This commit is contained in:
zombieFox 2019-07-20 11:40:26 +01:00
parent 5d6ccdc118
commit 8648f4d0d5
3 changed files with 13 additions and 6 deletions

View File

@ -1,6 +1,8 @@
var state = (function() {
var current = {
var mod = {};
mod.current = {
header: {
area: {
width: 100,
@ -218,11 +220,11 @@ var state = (function() {
autoSuggest: false,
};
var get = function() {
mod.get = function() {
return current;
};
var restore = function(data) {
mod.restore = function(data) {
if ("state" in data) {
current = data.state;
};
@ -230,12 +232,17 @@ var state = (function() {
var init = function() {
if (data.load()) {
restore(data.load());
mod.restore(data.load());
};
};
var get = function() {
return mod.get();
};
return {
init: init,
mod: mod,
get: get
};

View File

@ -1,6 +1,6 @@
var version = (function() {
var current = "3.57.0";
var current = "3.58.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.57.0",
"version": "3.58.0",
"manifest_version": 2,
"chrome_url_overrides": {
"newtab": "index.html"