mirror of
https://github.com/notion-enhancer/notion-enhancer.git
synced 2025-04-19 19:19:03 +00:00
Reordered side panel content loading
This commit is contained in:
parent
b453c41132
commit
443da9a330
@ -151,19 +151,21 @@ module.exports = {
|
|||||||
function loadContent(mod) {
|
function loadContent(mod) {
|
||||||
if (curPanelJs && curPanelJs.onSwitch) curPanelJs.onSwitch();
|
if (curPanelJs && curPanelJs.onSwitch) curPanelJs.onSwitch();
|
||||||
|
|
||||||
|
if (mod.panelJs) {
|
||||||
|
curPanelJs = require(mod.panelJs)(store(mod.id));
|
||||||
|
} else curPanelJs = null;
|
||||||
|
|
||||||
store().last_open = mod.id;
|
store().last_open = mod.id;
|
||||||
panel.querySelector('.enhancer-panel--title').innerText = mod.panel.name || mod.name;
|
panel.querySelector('.enhancer-panel--title').innerText = mod.panel.name || mod.name;
|
||||||
panel.querySelector('.enhancer-panel--icon').innerHTML = mod.panelIcon;
|
panel.querySelector('.enhancer-panel--icon').innerHTML = mod.panelIcon;
|
||||||
document.getElementById('enhancer-panel--content').innerHTML = mod.panelHtml;
|
document.getElementById('enhancer-panel--content').innerHTML = mod.panelHtml;
|
||||||
|
|
||||||
if (mod.panelJs) {
|
|
||||||
curPanelJs = require(mod.panelJs)(store(mod.id));
|
|
||||||
if (curPanelJs && curPanelJs.onLoad) curPanelJs.onLoad();
|
|
||||||
} else curPanelJs = null;
|
|
||||||
|
|
||||||
if (mod.panelFullHeight) {
|
if (mod.panelFullHeight) {
|
||||||
panel.dataset.fullHeight = mod.panelFullHeight;
|
panel.dataset.fullHeight = mod.panelFullHeight;
|
||||||
} else panel.dataset.fullHeight = '';
|
} else panel.dataset.fullHeight = '';
|
||||||
|
|
||||||
|
if (curPanelJs && curPanelJs.onLoad)
|
||||||
|
curPanelJs.onLoad();
|
||||||
}
|
}
|
||||||
|
|
||||||
function unlockPanel(animate) {
|
function unlockPanel(animate) {
|
||||||
|
Loading…
Reference in New Issue
Block a user