« get me outta code hell

tui-lib - Pure Node.js library for making visual command-line programs (ala vim, ncdu)
about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--ui/Dialog.js16
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')