diff options
author | Florrie <towerofnix@gmail.com> | 2018-07-03 01:14:41 -0300 |
---|---|---|
committer | Florrie <towerofnix@gmail.com> | 2018-07-03 01:14:41 -0300 |
commit | 1076bd5e65658a0e846a7892cee787ade7660bb2 (patch) | |
tree | aa71b547f738fc3e112155a2e9963ce14a4170f1 /ui | |
parent | 9743a9fcf7b8e5e5dd98cd1c74aefa36a3f70a94 (diff) |
Handy functions on Dialog
Diffstat (limited to 'ui')
-rw-r--r-- | ui/Dialog.js | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/ui/Dialog.js b/ui/Dialog.js index 26d94d8..f2db43d 100644 --- a/ui/Dialog.js +++ b/ui/Dialog.js @@ -29,6 +29,22 @@ module.exports = class Dialog extends FocusElement { this.h = this.parent.contentH } + open() { + this.opened() + this.visible = true + this.root.select(this) + this.fixLayout() + } + + close() { + this.closed() + this.visible = false + } + + opened() {} + + closed() {} + keyPressed(keyBuf) { if (telc.isCancel(keyBuf)) { this.emit('cancelled') |