mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-05 10:53:59 +00:00
style: format Layers panel components
This commit is contained in:
1 parent
07cf1695ff
commit
e34d619949
3 files changed
+158
-205
No files matched your search
@@ -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;
|
||||
|
||||
Reference in new issue
Block a user