mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-07-13 03:27:39 +03:00
Cleanup DOM boot
This commit is contained in:
parent
e1f1a3aa12
commit
90acc04750
3 changed files with 6 additions and 6 deletions
|
|
@ -3,6 +3,7 @@
|
||||||
|
|
||||||
const
|
const
|
||||||
doc = document,
|
doc = document,
|
||||||
|
html = doc.documentElement,
|
||||||
app = doc.getElementById('rl-app'),
|
app = doc.getElementById('rl-app'),
|
||||||
options = app && app.dataset.boot && JSON.parse(app.dataset.boot) || {},
|
options = app && app.dataset.boot && JSON.parse(app.dataset.boot) || {},
|
||||||
|
|
||||||
|
|
@ -151,7 +152,7 @@ win.__initAppData = appData => {
|
||||||
|
|
||||||
if (appData) {
|
if (appData) {
|
||||||
if (appData.NewThemeLink) {
|
if (appData.NewThemeLink) {
|
||||||
(doc.getElementById('app-theme-link') || {}).href = appData.NewThemeLink;
|
doc.getElementById('app-theme-link').href = appData.NewThemeLink;
|
||||||
}
|
}
|
||||||
|
|
||||||
appData.IncludeCss && writeCSS(appData.IncludeCss);
|
appData.IncludeCss && writeCSS(appData.IncludeCss);
|
||||||
|
|
@ -169,11 +170,10 @@ win.__initAppData = appData => {
|
||||||
|
|
||||||
const libs = () =>
|
const libs = () =>
|
||||||
loadScript(appData.StaticLibJsLink).then(() => {
|
loadScript(appData.StaticLibJsLink).then(() => {
|
||||||
doc.getElementById('rl-check').remove();
|
|
||||||
if (appData.IncludeBackground) {
|
if (appData.IncludeBackground) {
|
||||||
const img = appData.IncludeBackground.replace('{{USER}}', rl.hash.get() || '0');
|
const img = appData.IncludeBackground.replace('{{USER}}', rl.hash.get() || '0');
|
||||||
if (img) {
|
if (img) {
|
||||||
doc.documentElement.classList.add('UserBackground');
|
html.classList.add('UserBackground');
|
||||||
doc.body.style.backgroundImage = "url("+img+")";
|
doc.body.style.backgroundImage = "url("+img+")";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -220,6 +220,8 @@ Storage('session');
|
||||||
// init section
|
// init section
|
||||||
setInterval(setTimestamp, 60000); // 1m
|
setInterval(setTimestamp, 60000); // 1m
|
||||||
|
|
||||||
|
html.classList.add(options.mobileDevice ? 'mobile' : 'no-mobile');
|
||||||
|
|
||||||
['app-css','app-theme-link'].forEach(css => {
|
['app-css','app-theme-link'].forEach(css => {
|
||||||
css = doc.getElementById(css);
|
css = doc.getElementById(css);
|
||||||
css.href = css.dataset.href;
|
css.href = css.dataset.href;
|
||||||
|
|
|
||||||
3
dev/bootstrap.js
vendored
3
dev/bootstrap.js
vendored
|
|
@ -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 Enums from 'Common/Enums';
|
||||||
import * as Plugins from 'Common/Plugins';
|
import * as Plugins from 'Common/Plugins';
|
||||||
import { i18n } from 'Common/Translator';
|
import { i18n } from 'Common/Translator';
|
||||||
|
|
@ -31,7 +31,6 @@ export default (App) => {
|
||||||
});
|
});
|
||||||
addEventListener('unload', () => GlobalsData.bUnload = true);
|
addEventListener('unload', () => GlobalsData.bUnload = true);
|
||||||
|
|
||||||
$htmlCL.add(bMobileDevice ? 'mobile' : 'no-mobile');
|
|
||||||
addEventListener('click', ()=>rl.Dropdowns.detectVisibility());
|
addEventListener('click', ()=>rl.Dropdowns.detectVisibility());
|
||||||
|
|
||||||
rl.app = App;
|
rl.app = App;
|
||||||
|
|
|
||||||
|
|
@ -41,7 +41,6 @@
|
||||||
<div id="rl-templates"></div>
|
<div id="rl-templates"></div>
|
||||||
<div id="rl-hidden"></div>
|
<div id="rl-hidden"></div>
|
||||||
</div>
|
</div>
|
||||||
<div id="rl-check"></div>
|
|
||||||
<div class="progressjs"><div class="progressjs-inner"><div class="progressjs-percent"></div></div></div>
|
<div class="progressjs"><div class="progressjs-inner"><div class="progressjs-percent"></div></div></div>
|
||||||
<script type="text/javascript">{{BaseAppBootScript}}</script>
|
<script type="text/javascript">{{BaseAppBootScript}}</script>
|
||||||
</body>
|
</body>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue