mirror of
https://github.com/the-djmaze/snappymail.git
synced 2024-12-30 19:41:46 +08:00
Improved plugin documentation
This commit is contained in:
parent
6d6690009c
commit
92cec80b73
2 changed files with 22 additions and 6 deletions
|
@ -60,7 +60,7 @@ export class AbstractViewPopup extends AbstractView
|
||||||
this.keyScope.scope = name;
|
this.keyScope.scope = name;
|
||||||
this.modalVisible = ko.observable(false).extend({ rateLimit: 0 });
|
this.modalVisible = ko.observable(false).extend({ rateLimit: 0 });
|
||||||
shortcuts.add('escape,close', '', name, () => {
|
shortcuts.add('escape,close', '', name, () => {
|
||||||
if (this.modalVisible() && this.onClose()) {
|
if (this.modalVisible() && false !== this.onClose()) {
|
||||||
this.closeCommand();
|
this.closeCommand();
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -70,14 +70,13 @@ export class AbstractViewPopup extends AbstractView
|
||||||
}
|
}
|
||||||
|
|
||||||
// Happens when user hits Escape or Close key
|
// Happens when user hits Escape or Close key
|
||||||
onClose() {
|
// return false to prevent closing
|
||||||
return true; // false to prevent closing
|
onClose() {}
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
onBeforeShow() {} // Happens before showModal()
|
onBeforeShow() {} // Happens before showModal()
|
||||||
onShow() {} // Happens after showModal()
|
onShow() {} // Happens after showModal()
|
||||||
afterShow() {} // Happens after showModal() animation transitionend
|
afterShow() {} // Happens after showModal() animation transitionend
|
||||||
onHide() {} // Happens before animation transitionend
|
onHide() {} // Happens before animation transitionend
|
||||||
afterHide() {} // Happens after animation transitionend
|
afterHide() {} // Happens after animation transitionend
|
||||||
|
|
||||||
|
|
|
@ -17,6 +17,23 @@ JavaScript
|
||||||
```javascript
|
```javascript
|
||||||
class PluginPopupView extends rl.pluginPopupView
|
class PluginPopupView extends rl.pluginPopupView
|
||||||
{
|
{
|
||||||
|
// Happens when DOM is created
|
||||||
|
onBuild(dom) {}
|
||||||
|
|
||||||
|
// Happens before showModal()
|
||||||
|
onBeforeShow(...params) {}
|
||||||
|
// Happens after showModal()
|
||||||
|
onShow(...params) {}
|
||||||
|
// Happens after showModal() animation transitionend
|
||||||
|
afterShow() {}
|
||||||
|
|
||||||
|
// Happens when user hits Escape or Close key
|
||||||
|
// return false to prevent closing, use closeCommand() manually
|
||||||
|
onClose() {}
|
||||||
|
// Happens before animation transitionend
|
||||||
|
onHide() {}
|
||||||
|
// Happens after animation transitionend
|
||||||
|
afterHide() {}
|
||||||
}
|
}
|
||||||
|
|
||||||
PluginPopupView.showModal();
|
PluginPopupView.showModal();
|
||||||
|
|
Loading…
Reference in a new issue