big restructure
This commit is contained in:
40
web/js/app-boot.js
Normal file
40
web/js/app-boot.js
Normal file
@@ -0,0 +1,40 @@
|
||||
(function () {
|
||||
var root = document.documentElement;
|
||||
root.classList.remove('no-js');
|
||||
root.classList.add('js');
|
||||
root.classList.add('aside-pending');
|
||||
|
||||
var assetBase = root.dataset.assetBase || '';
|
||||
if (assetBase) {
|
||||
window.APP_ASSET_BASE = assetBase;
|
||||
}
|
||||
|
||||
try {
|
||||
if (window.localStorage.getItem('app-sidebar-collapsed') === '1') {
|
||||
root.classList.add('sidebar-collapsed');
|
||||
}
|
||||
if (window.localStorage.getItem('app-sidebar-hidden') === '1') {
|
||||
root.classList.add('sidebar-hidden');
|
||||
}
|
||||
var contrastValue = window.localStorage.getItem('app-contrast');
|
||||
if (contrastValue === 'high') {
|
||||
root.dataset.contrast = 'high';
|
||||
} else {
|
||||
root.dataset.contrast = 'normal';
|
||||
}
|
||||
} catch (e) {
|
||||
// ignore storage errors
|
||||
}
|
||||
|
||||
if (typeof window.requestFsLightboxRefresh !== 'function') {
|
||||
window.requestFsLightboxRefresh = function () {
|
||||
if (typeof window.refreshFsLightbox === 'function') {
|
||||
window.refreshFsLightbox();
|
||||
window.__fsLightboxRefreshPending = false;
|
||||
return true;
|
||||
}
|
||||
window.__fsLightboxRefreshPending = true;
|
||||
return false;
|
||||
};
|
||||
}
|
||||
})();
|
||||
Reference in New Issue
Block a user