From 24e8ed61d6111d1d6c4a27e133fce9edd5f767cb Mon Sep 17 00:00:00 2001 From: Florrie Date: Fri, 6 Jul 2018 12:21:14 -0300 Subject: New empty tab --- ui.js | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'ui.js') diff --git a/ui.js b/ui.js index a18cd4d..89801d7 100644 --- a/ui.js +++ b/ui.js @@ -334,6 +334,8 @@ class AppElement extends FocusElement { this.form.updateSelectedElement() } else if (keyBuf.equals(Buffer.from([5]))) { // Ctrl-E this.editMode = !this.editMode + } else if (this.editMode && keyBuf.equals(Buffer.from([14]))) { // ctrl-N + this.newEmptyTab() } else if (keyBuf.equals(Buffer.from([15]))) { // ctrl-O this.openPlaylistDialog.open() } else if (keyBuf.equals(Buffer.from([20]))) { // ctrl-T @@ -353,6 +355,14 @@ class AppElement extends FocusElement { } } + newEmptyTab() { + const listing = this.newGrouplikeListing() + listing.loadGrouplike({ + name: 'New Playlist', + items: [] + }) + } + cloneCurrentTab() { const grouplike = this.tabber.currentElement.grouplike const listing = this.newGrouplikeListing() -- cgit 1.3.0-6-gf8a5