return target;
},
+ hasTag: function (task: Element, tag: string) {
+ for (const child of task.children) {
+ if (child.classList.contains("tag") && child.textContent === tag) {
+ return true;
+ }
+ }
+ return false;
+ },
+
getPriority: function (task: Element): number {
if (task.hasAttribute("data-priority")) {
return parseFloat(task.getAttribute("data-priority")!);
input.removeEventListener("blur", this.completeTagEdit);
task.removeChild(input);
task.focus();
- ui.addTag(task.getAttribute("data-created")!, newTagName);
+ if (!Model.hasTag(task, newTagName)) {
+ ui.addTag(task.getAttribute("data-created")!, newTagName);
+ }
},
firstVisibleTask: function () {