X-Git-Url: http://git.scottworley.com/vopamoi/blobdiff_plain/c70b3eedcfa3521a21239d7f0a6d2168e063dea2..73ffc3d0a75d43591035c83f123525faddae3a3b:/vopamoi.ts diff --git a/vopamoi.ts b/vopamoi.ts index 135fe0a..31a4cdc 100644 --- a/vopamoi.ts +++ b/vopamoi.ts @@ -60,6 +60,12 @@ const Model = { tag.classList.add("tag"); tag.setAttribute("tabindex", "0"); hashHue(tagName).then((hue) => (tag.style.backgroundColor = `hsl(${hue},90%,45%)`)); + for (const child of task.getElementsByClassName("tag")) { + if (tagName > child.textContent!) { + task.insertBefore(tag, child); + return tag; + } + } task.appendChild(tag); return tag; },