style: format Layers panel components

This commit is contained in:
Sameh Khamis committed 2026-09-12 22:36:06 -07:00
1 parent 07cf1695ff
commit e34d619949
3 files changed
+158 -205

No files matched your search

+7 -2
View File
@@ -1,14 +1,19 @@
/** Keep the clear action focusable while busy; the caller owns its transaction. */
export function bindClearLayersControl(button, clear) {
let destroyed = false;
const click = () => { if (!destroyed) void clear(); };
const click = () => {
if (!destroyed) void clear();
};
button?.addEventListener('click', click);
return {
setBusy(busy) {
if (destroyed || !button) return;
button.setAttribute('aria-disabled', String(busy));
button.setAttribute('aria-busy', String(busy));
button.setAttribute('aria-label', busy ? 'Clearing selected data layers' : 'Clear selected data layers');
button.setAttribute(
'aria-label',
busy ? 'Clearing selected data layers' : 'Clear selected data layers',
);
},
destroy() {
destroyed = true;