From 9597dcc4d595e40173d3646d4e4a7a4fd59c2a4b Mon Sep 17 00:00:00 2001 From: dragonwocky Date: Wed, 11 Nov 2020 23:39:42 +1100 Subject: [PATCH] #192 remove draggable-indicator dots from tabs ext. in menu --- mods/core/enhancerMenu.js | 41 +++++++++++++++------------------------ mods/core/menu.css | 6 +++--- 2 files changed, 19 insertions(+), 28 deletions(-) diff --git a/mods/core/enhancerMenu.js b/mods/core/enhancerMenu.js index 72d9edc..7e59c47 100644 --- a/mods/core/enhancerMenu.js +++ b/mods/core/enhancerMenu.js @@ -44,23 +44,6 @@ window['__start'] = async () => { : store(args[0], { ...mod.defaults, ...args[1] }); }; - for (let mod of modules.loaded) { - if ( - mod.alwaysActive || - store('mods', { [mod.id]: { enabled: false } })[mod.id].enabled - ) { - const fileExists = (file) => fs.pathExistsSync(path.resolve(file)); - for (let sheet of ['menu', 'variables']) { - if (fileExists(`${__dirname}/../${mod.dir}/${sheet}.css`)) { - document.head.appendChild( - createElement( - `` - ) - ); - } - } - } - } electron.ipcRenderer.send('enhancer:get-app-theme'); electron.ipcRenderer.on('enhancer:set-app-theme', (event, theme) => { document.body.className = `notion-${theme}-theme`; @@ -509,15 +492,10 @@ window['__start'] = async () => { return $opt; } - const $modules = document.querySelector('#modules'); + const $modules = document.querySelector('#modules'), + fileExists = (file) => fs.pathExistsSync(path.resolve(file)); for (let mod of modules.loaded) { - for (let font of mod.fonts || []) { - document - .querySelector('head') - .appendChild(createElement(``)); - } - const enabled = mod.alwaysActive || store('mods', { @@ -531,8 +509,21 @@ window['__start'] = async () => { link: `https://github.com/${mod.author}`, avatar: `https://github.com/${mod.author}.png`, }; + if (enabled) { + for (let sheet of ['menu', 'variables']) { + if (fileExists(`${__dirname}/../${mod.dir}/${sheet}.css`)) { + document.head.appendChild( + createElement( + `` + ) + ); + } + } + } mod.elem = createElement(` -
+