Improve startup time

This commit is contained in:
JannisX11 2021-02-19 22:10:56 +01:00
parent 102a424c9a
commit 2c04d534a2
2 changed files with 47 additions and 37 deletions

View File

@ -95,35 +95,37 @@ const CustomTheme = {
})
Vue.nextTick(function() {
CustomTheme.fetchFromStorage();
var wrapper = $('#color_wrapper');
for (var key in CustomTheme.defaultColors) {
(() => {
var scope_key = key;
var hex = CustomTheme.data.colors[scope_key];
var last_color = hex;
var field = wrapper.find('#color_field_'+scope_key);
field.spectrum({
preferredFormat: "hex",
color: hex,
showAlpha: false,
showInput: true,
move(c) {
CustomTheme.data.colors[scope_key] = c.toHexString();
},
change(c) {
last_color = c.toHexString();
},
hide(c) {
CustomTheme.data.colors[scope_key] = last_color;
field.spectrum('set', last_color);
}
});
})()
}
})
},
setupDialog() {
var wrapper = $('#color_wrapper');
for (var key in CustomTheme.defaultColors) {
(() => {
var scope_key = key;
var hex = CustomTheme.data.colors[scope_key];
var last_color = hex;
var field = wrapper.find('#color_field_'+scope_key);
field.spectrum({
preferredFormat: "hex",
color: hex,
showAlpha: false,
showInput: true,
move(c) {
CustomTheme.data.colors[scope_key] = c.toHexString();
},
change(c) {
last_color = c.toHexString();
},
hide(c) {
CustomTheme.data.colors[scope_key] = last_color;
field.spectrum('set', last_color);
}
});
})()
}
CustomTheme.dialog_is_setup = true;
},
fetchFromStorage() {
var legacy_colors = 0;
var stored_theme = 0;

28
package-lock.json generated
View File

@ -30,9 +30,9 @@
}
},
"@electron/get": {
"version": "1.12.2",
"resolved": "https://registry.npmjs.org/@electron/get/-/get-1.12.2.tgz",
"integrity": "sha512-vAuHUbfvBQpYTJ5wB7uVIDq5c/Ry0fiTBMs7lnEYAo/qXXppIVcWdfBr57u6eRnKdVso7KSiH6p/LbQAG6Izrg==",
"version": "1.12.4",
"resolved": "https://registry.npmjs.org/@electron/get/-/get-1.12.4.tgz",
"integrity": "sha512-6nr9DbJPUR9Xujw6zD3y+rS95TyItEVM0NVjt1EehY2vUWfIgPiIPVHxCvaTS0xr2B+DRxovYVKbuOWqC35kjg==",
"dev": true,
"requires": {
"debug": "^4.1.1",
@ -42,8 +42,16 @@
"global-tunnel-ng": "^2.7.1",
"got": "^9.6.0",
"progress": "^2.0.3",
"sanitize-filename": "^1.6.2",
"semver": "^6.2.0",
"sumchecker": "^3.0.1"
},
"dependencies": {
"semver": {
"version": "6.3.0",
"resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz",
"integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==",
"dev": true
}
}
},
"@sindresorhus/is": {
@ -652,9 +660,9 @@
}
},
"core-js": {
"version": "3.8.1",
"resolved": "https://registry.npmjs.org/core-js/-/core-js-3.8.1.tgz",
"integrity": "sha512-9Id2xHY1W7m8hCl8NkhQn5CufmF/WuR30BTRewvCXc1aZd3kMECwNZ69ndLbekKfakw9Rf2Xyc+QR6E7Gg+obg==",
"version": "3.9.0",
"resolved": "https://registry.npmjs.org/core-js/-/core-js-3.9.0.tgz",
"integrity": "sha512-PyFBJaLq93FlyYdsndE5VaueA9K5cNB7CGzeCj191YYLhkQM0gdZR2SKihM70oF0wdqKSKClv/tEBOpoRmdOVQ==",
"dev": true,
"optional": true
},
@ -836,9 +844,9 @@
},
"dependencies": {
"@types/node": {
"version": "12.19.9",
"resolved": "https://registry.npmjs.org/@types/node/-/node-12.19.9.tgz",
"integrity": "sha512-yj0DOaQeUrk3nJ0bd3Y5PeDRJ6W0r+kilosLA+dzF3dola/o9hxhMSg2sFvVcA2UHS5JSOsZp4S0c1OEXc4m1Q==",
"version": "12.20.4",
"resolved": "https://registry.npmjs.org/@types/node/-/node-12.20.4.tgz",
"integrity": "sha512-xRCgeE0Q4pT5UZ189TJ3SpYuX/QGl6QIAOAIeDSbAVAd2gX1NxSZup4jNVK7cxIeP8KDSbJgcckun495isP1jQ==",
"dev": true
}
}