From 90acc04750313443b2e0cba28f28d9c33e720d36 Mon Sep 17 00:00:00 2001 From: djmaze Date: Wed, 9 Sep 2020 16:53:36 +0200 Subject: [PATCH] Cleanup DOM boot --- dev/boot.js | 8 +++++--- dev/bootstrap.js | 3 +-- rainloop/v/0.0.0/app/templates/Index.html | 1 - 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/dev/boot.js b/dev/boot.js index 0d8bc6da4..4747a3e3e 100644 --- a/dev/boot.js +++ b/dev/boot.js @@ -3,6 +3,7 @@ const doc = document, + html = doc.documentElement, app = doc.getElementById('rl-app'), options = app && app.dataset.boot && JSON.parse(app.dataset.boot) || {}, @@ -151,7 +152,7 @@ win.__initAppData = appData => { if (appData) { if (appData.NewThemeLink) { - (doc.getElementById('app-theme-link') || {}).href = appData.NewThemeLink; + doc.getElementById('app-theme-link').href = appData.NewThemeLink; } appData.IncludeCss && writeCSS(appData.IncludeCss); @@ -169,11 +170,10 @@ win.__initAppData = appData => { const libs = () => loadScript(appData.StaticLibJsLink).then(() => { - doc.getElementById('rl-check').remove(); if (appData.IncludeBackground) { const img = appData.IncludeBackground.replace('{{USER}}', rl.hash.get() || '0'); if (img) { - doc.documentElement.classList.add('UserBackground'); + html.classList.add('UserBackground'); doc.body.style.backgroundImage = "url("+img+")"; } } @@ -220,6 +220,8 @@ Storage('session'); // init section setInterval(setTimestamp, 60000); // 1m +html.classList.add(options.mobileDevice ? 'mobile' : 'no-mobile'); + ['app-css','app-theme-link'].forEach(css => { css = doc.getElementById(css); css.href = css.dataset.href; diff --git a/dev/bootstrap.js b/dev/bootstrap.js index c8f661af4..2b23f75c0 100644 --- a/dev/bootstrap.js +++ b/dev/bootstrap.js @@ -1,4 +1,4 @@ -import { $htmlCL, data as GlobalsData, bMobileDevice, dropdownVisibility } from 'Common/Globals'; +import { data as GlobalsData, bMobileDevice, dropdownVisibility } from 'Common/Globals'; import * as Enums from 'Common/Enums'; import * as Plugins from 'Common/Plugins'; import { i18n } from 'Common/Translator'; @@ -31,7 +31,6 @@ export default (App) => { }); addEventListener('unload', () => GlobalsData.bUnload = true); - $htmlCL.add(bMobileDevice ? 'mobile' : 'no-mobile'); addEventListener('click', ()=>rl.Dropdowns.detectVisibility()); rl.app = App; diff --git a/rainloop/v/0.0.0/app/templates/Index.html b/rainloop/v/0.0.0/app/templates/Index.html index 6c034e242..5d3e7fe73 100644 --- a/rainloop/v/0.0.0/app/templates/Index.html +++ b/rainloop/v/0.0.0/app/templates/Index.html @@ -41,7 +41,6 @@
-