mirror of
https://github.com/notion-enhancer/notion-enhancer.git
synced 2025-04-29 07:29:07 +00:00
Add onLock and onUnlock functions to panel extensions
This commit is contained in:
parent
4cb0bf6b56
commit
b453c41132
@ -159,7 +159,7 @@ module.exports = {
|
|||||||
if (mod.panelJs) {
|
if (mod.panelJs) {
|
||||||
curPanelJs = require(mod.panelJs)(store(mod.id));
|
curPanelJs = require(mod.panelJs)(store(mod.id));
|
||||||
if (curPanelJs && curPanelJs.onLoad) curPanelJs.onLoad();
|
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;
|
||||||
@ -188,6 +188,10 @@ module.exports = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
hidePanel();
|
hidePanel();
|
||||||
|
|
||||||
|
if (curPanelJs && curPanelJs.onUnlock) {
|
||||||
|
curPanelJs.onUnlock();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function lockPanel() {
|
function lockPanel() {
|
||||||
@ -201,6 +205,10 @@ module.exports = {
|
|||||||
// Hover event listeners
|
// Hover event listeners
|
||||||
panel.removeEventListener('mouseover', showPanel);
|
panel.removeEventListener('mouseover', showPanel);
|
||||||
panel.removeEventListener('mouseleave', hidePanel);
|
panel.removeEventListener('mouseleave', hidePanel);
|
||||||
|
|
||||||
|
if (curPanelJs && curPanelJs.onLock) {
|
||||||
|
curPanelJs.onLock();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function togglePanel(e) {
|
function togglePanel(e) {
|
||||||
@ -302,10 +310,6 @@ module.exports = {
|
|||||||
frame.style.paddingRight = 0;
|
frame.style.paddingRight = 0;
|
||||||
panel.style.right = width + 'px';
|
panel.style.right = width + 'px';
|
||||||
}
|
}
|
||||||
|
|
||||||
if (curPanelJs && curPanelJs.onResize) {
|
|
||||||
curPanelJs.onResize();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function enableResize() {
|
function enableResize() {
|
||||||
@ -342,6 +346,10 @@ module.exports = {
|
|||||||
if (width < 190) width = 190;
|
if (width < 190) width = 190;
|
||||||
if (width > 480) width = 480;
|
if (width > 480) width = 480;
|
||||||
setPanelWidth(width);
|
setPanelWidth(width);
|
||||||
|
|
||||||
|
if (curPanelJs && curPanelJs.onResize) {
|
||||||
|
curPanelJs.onResize();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function stopDrag() {
|
function stopDrag() {
|
||||||
|
Loading…
Reference in New Issue
Block a user