mirror of
https://github.com/the-djmaze/snappymail.git
synced 2024-11-10 09:02:45 +08: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
|
||||
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;
|
||||
|
|
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 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;
|
||||
|
|
|
@ -41,7 +41,6 @@
|
|||
<div id="rl-templates"></div>
|
||||
<div id="rl-hidden"></div>
|
||||
</div>
|
||||
<div id="rl-check"></div>
|
||||
<div class="progressjs"><div class="progressjs-inner"><div class="progressjs-percent"></div></div></div>
|
||||
<script type="text/javascript">{{BaseAppBootScript}}</script>
|
||||
</body>
|
||||
|
|
Loading…
Reference in a new issue