updated javascript dependencies and changed 'theme' to a constant in zulma_switchcss

This commit is contained in:
Robert Clarke 2019-10-28 15:42:01 +00:00
parent 435dfd6968
commit 4879e7c276
9 changed files with 4693 additions and 4530 deletions

View file

@ -1,16 +1,16 @@
{
"devDependencies": {
"@babel/core": "^7.4.4",
"@babel/preset-env": "^7.4.4",
"babel-loader": "^8.0.5",
"eslint": "^5.16.0",
"eslint-config-standard": "^12.0.0",
"eslint-loader": "^2.1.2",
"eslint-plugin-import": "^2.17.2",
"eslint-plugin-node": "^9.0.1",
"eslint-plugin-promise": "^4.1.1",
"eslint-plugin-standard": "^4.0.0",
"webpack": "^4.30.0",
"webpack-cli": "^3.3.2"
"@babel/core": "^7.6.4",
"@babel/preset-env": "^7.6.3",
"babel-loader": "^8.0.6",
"eslint": "^6.6.0",
"eslint-config-standard": "^14.1.0",
"eslint-loader": "^3.0.2",
"eslint-plugin-import": "^2.18.2",
"eslint-plugin-node": "^10.0.0",
"eslint-plugin-promise": "^4.2.1",
"eslint-plugin-standard": "^4.0.1",
"webpack": "^4.41.2",
"webpack-cli": "^3.3.9"
}
}

View file

@ -1,12 +1,12 @@
(function(switch_css) {
//Constants
const THEME_KEY = "ZULMA_THEME";
const THEME = localStorage.getItem(THEME_KEY);
const STOP_BLINK_CSS_ID = "stop-blink";
const STYLESHEET_CLASSNAME = "stylesheet";
//Variables
let previousLink = null;
let theme = localStorage.getItem(THEME_KEY);
//Events
/* The function called when the css has finished loading */
@ -143,13 +143,13 @@
//Public Methods
switch_css.init = function() {
//if user has selected and theme and it is not the current theme
if (theme && !document.getElementById(theme)) {
if (THEME && !document.getElementById(THEME)) {
//hide the body to stop FOUC
hideBody();
//change the theme
changeTheme(theme, true);
changeTheme(THEME, true);
//when the DOM is loaded, change the select to their current choice
updateThemeSelect(theme, true);
updateThemeSelect(THEME, true);
}
//when the DOM is loaded, set the dropdown to trigger the theme change
window.addEventListener("DOMContentLoaded", () => {

File diff suppressed because it is too large Load diff