mirror of
https://github.com/imputnet/cobalt.git
synced 2025-06-28 09:28:29 +00:00
web/SupportedServices: speed up the secondary expand by ~200μs
Some checks failed
CodeQL / Analyze (${{ matrix.language }}) (none, javascript-typescript) (push) Has been cancelled
Run service tests / test service functionality (push) Has been cancelled
Run tests / check lockfile correctness (push) Has been cancelled
Run tests / web sanity check (push) Has been cancelled
Run tests / api sanity check (push) Has been cancelled
Run service tests / test service: ${{ matrix.service }} (push) Has been cancelled
Some checks failed
CodeQL / Analyze (${{ matrix.language }}) (none, javascript-typescript) (push) Has been cancelled
Run service tests / test service functionality (push) Has been cancelled
Run tests / check lockfile correctness (push) Has been cancelled
Run tests / web sanity check (push) Has been cancelled
Run tests / api sanity check (push) Has been cancelled
Run service tests / test service: ${{ matrix.service }} (push) Has been cancelled
This commit is contained in:
parent
2e4b76de6e
commit
4cdbb02de2
@ -23,20 +23,26 @@
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const popoverAction = async () => {
|
||||||
|
expanded = !expanded;
|
||||||
|
if (expanded && services.length === 0) {
|
||||||
|
await loadInfo();
|
||||||
|
}
|
||||||
|
if (expanded) {
|
||||||
|
popover.focus();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
const showPopover = async () => {
|
const showPopover = async () => {
|
||||||
const timeout = renderPopover ? 0 : 10;
|
const timeout = !renderPopover;
|
||||||
renderPopover = true;
|
renderPopover = true;
|
||||||
|
|
||||||
// 10ms delay to let the popover render for the first time
|
// 10ms delay to let the popover render for the first time
|
||||||
setTimeout(async () => {
|
if (timeout) {
|
||||||
expanded = !expanded;
|
setTimeout(popoverAction, 10);
|
||||||
if (expanded && services.length === 0) {
|
} else {
|
||||||
await loadInfo();
|
await popoverAction();
|
||||||
}
|
}
|
||||||
if (expanded) {
|
|
||||||
popover.focus();
|
|
||||||
}
|
|
||||||
}, timeout);
|
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user