diff --git a/dev/App/Abstract.js b/dev/App/Abstract.js index 547f22eca..4453a7f89 100644 --- a/dev/App/Abstract.js +++ b/dev/App/Abstract.js @@ -165,6 +165,16 @@ class AbstractApp { LanguageStore.populate(); ThemeStore.populate(); } + + /** + * @returns {void} + */ + hideLoading() { + const id = id => document.getElementById(id); + id('rl-content').hidden = false; + id('rl-loading').remove(); + } + } export { AbstractApp, AbstractApp as default }; diff --git a/dev/App/Admin.js b/dev/App/Admin.js index 78d2c57d0..e3e185e68 100644 --- a/dev/App/Admin.js +++ b/dev/App/Admin.js @@ -12,7 +12,7 @@ import Remote from 'Remote/Admin/Fetch'; import { SettingsAdminScreen } from 'Screen/Admin/Settings'; import { LoginAdminScreen } from 'Screen/Admin/Login'; -import { hideLoading, startScreens } from 'Knoin/Knoin'; +import { startScreens } from 'Knoin/Knoin'; import { AbstractApp } from 'App/Abstract'; class AdminApp extends AbstractApp { @@ -104,7 +104,7 @@ class AdminApp extends AbstractApp { AppStore.populate(); CapaStore.populate(); - hideLoading(); + this.hideLoading(); if (!rl.settings.app('allowAdminPanel')) { rl.route.root(); diff --git a/dev/App/User.js b/dev/App/User.js index 9cda8ebcb..3f0ff3471 100644 --- a/dev/App/User.js +++ b/dev/App/User.js @@ -68,7 +68,7 @@ import { LoginUserScreen } from 'Screen/User/Login'; import { MailBoxUserScreen } from 'Screen/User/MailBox'; import { SettingsUserScreen } from 'Screen/User/Settings'; -import { hideLoading, startScreens, showScreenPopup } from 'Knoin/Knoin'; +import { startScreens, showScreenPopup } from 'Knoin/Knoin'; import { AbstractApp } from 'App/Abstract'; @@ -907,7 +907,7 @@ class AppUser extends AbstractApp { if (window.progressJs) { progressJs.end(); } - hideLoading(); + this.hideLoading(); } bootstart() { diff --git a/dev/Knoin/Knoin.js b/dev/Knoin/Knoin.js index 5498e8f74..ac1579970 100644 --- a/dev/Knoin/Knoin.js +++ b/dev/Knoin/Knoin.js @@ -9,7 +9,6 @@ let currentScreen = null, popupVisibilityNames = []; const SCREENS = {}, - qs = s => document.querySelector(s), isNonEmptyArray = Array.isNotEmpty, autofocus = dom => { // if (!bMobileDevice) { @@ -26,14 +25,6 @@ export const ViewType = { Center: 'Center' }; -/** - * @returns {void} - */ -export function hideLoading() { - qs('#rl-content').hidden = false; - qs('#rl-loading').remove(); -} - /** * @param {Function} fExecute * @param {(Function|boolean|null)=} fCanExecute = true @@ -125,7 +116,7 @@ function buildViewModel(ViewModelClass, vmScreen) { let vmDom = null; const vm = new ViewModelClass(vmScreen), position = ViewModelClass.__type || '', - vmPlace = position ? qs('#rl-content #rl-' + position.toLowerCase()) : null; + vmPlace = position ? document.querySelector('#rl-content #rl-' + position.toLowerCase()) : null; ViewModelClass.__builded = true; ViewModelClass.__vm = vm;