From a2df21923325f392246560d660400c1a1f4b80d1 Mon Sep 17 00:00:00 2001 From: Jack Date: Sat, 17 Oct 2020 19:50:29 +0100 Subject: [PATCH] added an option to clear all tags --- public/js/commandline.js | 26 +++++++++++++++++++++++--- 1 file changed, 23 insertions(+), 3 deletions(-) diff --git a/public/js/commandline.js b/public/js/commandline.js index 7ae36b9fd..56592e80b 100644 --- a/public/js/commandline.js +++ b/public/js/commandline.js @@ -1269,6 +1269,19 @@ let commandsTags = { function updateCommandsTagsList() { if (dbSnapshot.tags.length > 0) { commandsTags.list = []; + + commandsTags.list.push({ + id: "clearTags", + display: 'Clear tags', + exec: () => { + dbSnapshot.tags.forEach((tag) => { + tag.active = false; + }); + updateTestModesNotice(); + saveActiveTagsToCookie(); + }, + }); + dbSnapshot.tags.forEach((tag) => { let dis = tag.name; @@ -1292,9 +1305,16 @@ function updateCommandsTagsList() { } else { txt = '' + txt; } - $( - `#commandLine .suggestions .entry[command='toggleTag${tag.id}']` - ).html(txt); + if (isSingleListCommandLineActive()) { + $( + `#commandLine .suggestions .entry[command='toggleTag${tag.id}']` + ).html('Change tags > ' + txt); + } else { + $( + `#commandLine .suggestions .entry[command='toggleTag${tag.id}']` + ).html(txt); + } + }, }); });