From e90f95077be409333d0e7d67c84c84352245fae2 Mon Sep 17 00:00:00 2001 From: Florrie Date: Wed, 25 Jul 2018 14:16:33 -0300 Subject: Only show 'shuffle' context menu options on groups This really puts the "context" in "context menu"! --- ui.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ui.js b/ui.js index f686ba9..e6ae644 100644 --- a/ui.js +++ b/ui.js @@ -976,8 +976,8 @@ class GrouplikeItemElement extends Button { {label: 'Play', action: () => this.emit('play')}, {label: 'Play next', action: () => this.emit('queue (play next)')}, {label: 'Play at end', action: () => this.emit('queue (at end)')}, - {label: 'Play next, shuffled', action: () => this.emit('queue (play next, shuffled)')}, - {label: 'Play at end, shuffled', action: () => this.emit('queue (at end, shuffled)')} + isGroup(this.item) && {label: 'Play next, shuffled', action: () => this.emit('queue (play next, shuffled)')}, + isGroup(this.item) && {label: 'Play at end, shuffled', action: () => this.emit('queue (at end, shuffled)')} ] }) } @@ -1470,7 +1470,7 @@ class ContextMenu extends FocusElement { this.visible = true // TODO: Actions, that sorta thing - for (const { label, action } of items) { + for (const { label, action } of items.filter(Boolean)) { const button = new Button(label) if (action) { button.on('pressed', () => { -- cgit 1.3.0-6-gf8a5