From 8b1ce26fa6fc5fba78e67c4ddbbdc20127117336 Mon Sep 17 00:00:00 2001 From: MystaraTheGreat Date: Sun, 7 Mar 2021 11:05:29 +0000 Subject: [PATCH] Added hiddenOnStartup flag to module configuration options to cause a module to be iniitally hidden after starting up --- js/loader.js | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/js/loader.js b/js/loader.js index 91a17329..a3c639d0 100644 --- a/js/loader.js +++ b/js/loader.js @@ -54,6 +54,16 @@ var Loader = (function () { // Notify core of loaded modules. MM.modulesStarted(moduleObjects); + + // Starting modules also hides any modules that have requeste dto be initially hidden + for (var m in moduleObjects) { + var module = moduleObjects[m]; + + if (module.data.hiddenOnStartup) { + Log.info("Initially hiding " + module.name); + module.hide(); + } + } }; /** @@ -97,6 +107,7 @@ var Loader = (function () { path: moduleFolder + "/", file: moduleName + ".js", position: moduleData.position, + hiddenOnStartup: moduleData.hiddenOnStartup, header: moduleData.header, configDeepMerge: typeof moduleData.configDeepMerge === "boolean" ? moduleData.configDeepMerge : false, config: moduleData.config,