mirror of
https://github.com/monkeytypegame/monkeytype.git
synced 2025-02-02 20:08:18 +08:00
added an option to clear all tags
This commit is contained in:
parent
b418dae153
commit
a2df219233
1 changed files with 23 additions and 3 deletions
|
@ -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 = '<i class="fas fa-square"></i>' + 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);
|
||||
}
|
||||
|
||||
},
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Reference in a new issue