#192 remove draggable-indicator dots from tabs ext. in menu

This commit is contained in:
dragonwocky 2020-11-11 23:39:42 +11:00
parent bc46ac39b0
commit 9597dcc4d5
Signed by: dragonwocky
GPG Key ID: C7A48B7846AA706D
2 changed files with 19 additions and 28 deletions

View File

@ -44,23 +44,6 @@ window['__start'] = async () => {
: store(args[0], { ...mod.defaults, ...args[1] }); : 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(
`<link rel="stylesheet" href="enhancement://${mod.dir}/${sheet}.css">`
)
);
}
}
}
}
electron.ipcRenderer.send('enhancer:get-app-theme'); electron.ipcRenderer.send('enhancer:get-app-theme');
electron.ipcRenderer.on('enhancer:set-app-theme', (event, theme) => { electron.ipcRenderer.on('enhancer:set-app-theme', (event, theme) => {
document.body.className = `notion-${theme}-theme`; document.body.className = `notion-${theme}-theme`;
@ -509,15 +492,10 @@ window['__start'] = async () => {
return $opt; 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 mod of modules.loaded) {
for (let font of mod.fonts || []) {
document
.querySelector('head')
.appendChild(createElement(`<link rel="stylesheet" href="${font}">`));
}
const enabled = const enabled =
mod.alwaysActive || mod.alwaysActive ||
store('mods', { store('mods', {
@ -531,8 +509,21 @@ window['__start'] = async () => {
link: `https://github.com/${mod.author}`, link: `https://github.com/${mod.author}`,
avatar: `https://github.com/${mod.author}.png`, 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(
`<link rel="stylesheet" href="enhancement://${mod.dir}/${sheet}.css">`
)
);
}
}
}
mod.elem = createElement(` mod.elem = createElement(`
<section class="${enabled ? 'enabled' : 'disabled'}" id="${mod.id}"> <section class="${enabled ? 'enabled' : 'disabled'}${
mod.tags.includes('core') ? ' core' : ''
}" id="${mod.id}">
<div class="meta"> <div class="meta">
<h3 ${ <h3 ${
mod.alwaysActive mod.alwaysActive

View File

@ -663,10 +663,10 @@ svg[data-tooltip] {
.reorder #modules .version { .reorder #modules .version {
display: none; display: none;
} }
.reorder #modules label { .reorder #modules .core .toggle * {
cursor: pointer; cursor: text;
} }
.reorder #modules label::before { .reorder #modules section:not(.core) label::before {
content: '::'; content: '::';
margin-right: 0.4em; margin-right: 0.4em;
color: var(--theme--text_ui); color: var(--theme--text_ui);