« get me outta code hell

Show track title in context menus - mtui - Music Text User Interface - user-friendly command line music player
about summary refs log tree commit diff
path: root/ui.js
diff options
context:
space:
mode:
authorFlorrie <towerofnix@gmail.com>2019-05-12 16:28:41 -0300
committerFlorrie <towerofnix@gmail.com>2019-05-12 16:28:41 -0300
commit276b6bc65c7e0067c3bbcda575b4599459386f21 (patch)
tree8c348475d94453b63b731814ad0d68f6ebed2c3e /ui.js
parent6ba08342206625bcabb224c8f8c30db9500597c4 (diff)
Show track title in context menus
...rather than just leaving a blank space where the title should be.
Diffstat (limited to 'ui.js')
-rw-r--r--ui.js16
1 files changed, 10 insertions, 6 deletions
diff --git a/ui.js b/ui.js
index 7111493..d838a1d 100644
--- a/ui.js
+++ b/ui.js
@@ -355,11 +355,15 @@ class AppElement extends FocusElement {
     } else {
       items = [
         // A label that just shows some brief information about the item.
-        isGroup && {label:
-          `(${item.name ? `"${item.name}"` : 'Unnamed'} -` +
-          ` ${item.items.length} item${item.items.length === 1 ? '' : 's'}` +
-          `, ${countTotalItems(item)} total` +
-          ')', keyboardIdentifier: item.name},
+        {label:
+          `(${item.name ? `"${item.name}"` : 'Unnamed'}` +
+          (isGroup ? (
+            ' -' +
+            ` ${item.items.length} item${item.items.length === 1 ? '' : 's'}` +
+            `, ${countTotalItems(item)} total`)
+          : '') + ')',
+          keyboardIdentifier: item.name
+        },
 
         // The actual controls!
         {divider: true},
@@ -376,7 +380,7 @@ class AppElement extends FocusElement {
         editMode && {divider: true},
 
         {element: this.whereControl},
-        {element: this.orderControl},
+        isGroup && {element: this.orderControl},
         {label: 'Play!', action: emitControls(true)},
         {label: 'Queue!', action: emitControls(false)},
         {divider: true},