X-Git-Url: http://git.scottworley.com/vopamoi/blobdiff_plain/c70b3eedcfa3521a21239d7f0a6d2168e063dea2..360beccbbfadcc25606af08d13d64fd878469ecc:/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; },