refactoring
This commit is contained in:
parent
f64d3942d7
commit
dad6a77645
|
@ -101,15 +101,12 @@ window.addEventListener('resize', () => {
|
||||||
});
|
});
|
||||||
//#endregion
|
//#endregion
|
||||||
|
|
||||||
// Get the <head> element
|
|
||||||
const head = document.getElementsByTagName('head')[0];
|
|
||||||
|
|
||||||
// If mobile, insert the viewport meta tag
|
// If mobile, insert the viewport meta tag
|
||||||
if (isMobile || window.innerWidth <= 1024) {
|
if (isMobile || window.innerWidth <= 1024) {
|
||||||
const viewport = document.getElementsByName('viewport').item(0);
|
const viewport = document.getElementsByName('viewport').item(0);
|
||||||
viewport.setAttribute('content',
|
viewport.setAttribute('content',
|
||||||
`${viewport.getAttribute('content')},minimum-scale=1,maximum-scale=1,user-scalable=no`);
|
`${viewport.getAttribute('content')},minimum-scale=1,maximum-scale=1,user-scalable=no`);
|
||||||
head.appendChild(viewport);
|
document.head.appendChild(viewport);
|
||||||
}
|
}
|
||||||
|
|
||||||
//#region Set lang attr
|
//#region Set lang attr
|
||||||
|
|
|
@ -60,8 +60,6 @@
|
||||||
? `?salt=${localStorage.getItem('salt')}`
|
? `?salt=${localStorage.getItem('salt')}`
|
||||||
: '';
|
: '';
|
||||||
|
|
||||||
const head = document.getElementsByTagName('head')[0];
|
|
||||||
|
|
||||||
const script = document.createElement('script');
|
const script = document.createElement('script');
|
||||||
script.setAttribute('src', `/assets/app.${v}.js${salt}`);
|
script.setAttribute('src', `/assets/app.${v}.js${salt}`);
|
||||||
script.setAttribute('async', 'true');
|
script.setAttribute('async', 'true');
|
||||||
|
@ -70,7 +68,7 @@
|
||||||
renderError('APP_FETCH_FAILED');
|
renderError('APP_FETCH_FAILED');
|
||||||
checkUpdate();
|
checkUpdate();
|
||||||
});
|
});
|
||||||
head.appendChild(script);
|
document.head.appendChild(script);
|
||||||
//#endregion
|
//#endregion
|
||||||
|
|
||||||
//#region Theme
|
//#region Theme
|
||||||
|
|
Loading…
Reference in a new issue