From 1076bd5e65658a0e846a7892cee787ade7660bb2 Mon Sep 17 00:00:00 2001 From: Florrie Date: Tue, 3 Jul 2018 01:14:41 -0300 Subject: Handy functions on Dialog --- ui/Dialog.js | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'ui/Dialog.js') 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') -- cgit 1.3.0-6-gf8a5