« get me outta code hell

Hide context menu when it's unselected - mtui - Music Text User Interface - user-friendly command line music player
about summary refs log tree commit diff
diff options
context:
space:
mode:
authorFlorrie <towerofnix@gmail.com>2018-11-23 12:48:17 -0400
committerFlorrie <towerofnix@gmail.com>2018-11-23 12:48:17 -0400
commita928d7de2780afc82ea25ed7dffdf203e13dc3a5 (patch)
tree12f33707b3f5aabdb8c0e3a708077b16fcda4c4d
parent3b5bea9be912902f962ed4619092d10fc92e7988 (diff)
Hide context menu when it's unselected
m---------tui-lib0
-rw-r--r--ui.js5
2 files changed, 5 insertions, 0 deletions
diff --git a/tui-lib b/tui-lib
-Subproject 61eb3d20f95a47d1c52edba14a1177d70cdf319
+Subproject 09e1daec696ac8cb41c45029d298135340fc6ed
diff --git a/ui.js b/ui.js
index df05bf0..7bc6ed2 100644
--- a/ui.js
+++ b/ui.js
@@ -1682,6 +1682,11 @@ class ContextMenu extends FocusElement {
     }
   }
 
+  unselected() {
+    this.selectedBefore = this.root.selectedElement
+    this.close()
+  }
+
   close() {
     this.clearItems()
     this.visible = false