diff options
Diffstat (limited to 'static/modules/windows.js')
| -rw-r--r-- | static/modules/windows.js | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/static/modules/windows.js b/static/modules/windows.js index 7d2d8c8..018cc6a 100644 --- a/static/modules/windows.js +++ b/static/modules/windows.js @@ -61,9 +61,21 @@ export default { const launches = el.querySelector(".launches"); launches.textContent = ""; - for (const key of st.launches ?? []) { - const b = tile(key, () => post("launch", { key })); - b.classList.add("launch"); + for (const item of st.launches ?? []) { + const b = document.createElement("button"); + b.className = "wtile launch"; + b.setAttribute("aria-label", item.label || item.key); + b.title = item.label || item.key; + if (item.icon) { + const icon = document.createElement("span"); + icon.className = "laticon"; + icon.style.webkitMaskImage = `url(/logos/${item.icon}.svg)`; + icon.style.maskImage = `url(/logos/${item.icon}.svg)`; + b.append(icon); + } else { + b.textContent = item.label || item.key; + } + b.onclick = () => post("launch", { key: item.key }); launches.append(b); } }, |
