X-Git-Url: http://git.scottworley.com/vopamoi/blobdiff_plain/f366a8213c2d36700fbf7d384ac93d55f0934f72..54c191805520acf16e11b41f812571cfaf93706f:/vopamoi.ts diff --git a/vopamoi.ts b/vopamoi.ts index 6e511a5..cbb9af2 100644 --- a/vopamoi.ts +++ b/vopamoi.ts @@ -80,8 +80,8 @@ const Model = { }, hasTag: function (task: Element, tag: string): Element | null { - for (const child of task.children) { - if (child.classList.contains("tag") && child.textContent === tag) { + for (const child of task.getElementsByClassName("tag")) { + if (child.textContent === tag) { return child; } } @@ -284,7 +284,7 @@ function BrowserUI() { input.removeEventListener("blur", this.completeTagEdit); task.removeChild(input); task.focus(); - if (newTagName && !Model.hasTag(task, newTagName)) { + if (resolution === CommitOrAbort.Commit && newTagName && !Model.hasTag(task, newTagName)) { ui.addTag(task.getAttribute("data-created")!, newTagName); lastTagNameEntered = newTagName; }