From a9699f2e27af0a362f54e30e6347b658ef0c99eb Mon Sep 17 00:00:00 2001 From: jean-emmanuel Date: Tue, 1 Mar 2022 11:03:10 +0100 Subject: [PATCH] root: better lazy loading of menu component --- src/client/widgets/containers/root.js | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/client/widgets/containers/root.js b/src/client/widgets/containers/root.js index 00bf455b..9803494f 100644 --- a/src/client/widgets/containers/root.js +++ b/src/client/widgets/containers/root.js @@ -2,10 +2,6 @@ var Panel = require('./panel'), StaticProperties = require('../mixins/static_properties'), mainMenu -setTimeout(()=>{ - mainMenu= require('../../ui/main-menu') -}) - class Root extends StaticProperties(Panel, {visible: true, label: false, id: 'root'}) { static description() { @@ -60,12 +56,14 @@ class Root extends StaticProperties(Panel, {visible: true, label: false, id: 'ro if (READ_ONLY) return + mainMenu = mainMenu || require('../../ui/main-menu') + if (this.getProp('hideMenu')) { mainMenu.container.style.display = 'none' } else { mainMenu.container.style.display = '' } - + } isVisible() {