mirror of
https://github.com/bitcoinresearchkit/brk.git
synced 2026-04-24 06:39:58 -07:00
global: snapshot
This commit is contained in:
@@ -9,6 +9,7 @@ import {
|
||||
} from "./panes/chart.js";
|
||||
import { initSearch } from "./panes/search.js";
|
||||
import { replaceHistory } from "./utils/url.js";
|
||||
import { idle } from "./utils/timing.js";
|
||||
import { removeStored, writeToStorage } from "./utils/storage.js";
|
||||
import {
|
||||
asideElement,
|
||||
@@ -194,7 +195,7 @@ function initSelected() {
|
||||
}
|
||||
initSelected();
|
||||
|
||||
requestIdleCallback(() => options.setParent(navElement));
|
||||
idle(() => options.setParent(navElement));
|
||||
|
||||
onFirstIntersection(navElement, () => {
|
||||
options.setParent(navElement);
|
||||
|
||||
@@ -389,10 +389,6 @@ export function initOptions() {
|
||||
|
||||
const onSelectedPath = isOnSelectedPath(node.path);
|
||||
|
||||
if (onSelectedPath) {
|
||||
li.dataset.highlight = "";
|
||||
}
|
||||
|
||||
if (node.type === "group") {
|
||||
const details = window.document.createElement("details");
|
||||
details.dataset.name = node.serName;
|
||||
@@ -439,6 +435,7 @@ export function initOptions() {
|
||||
if (parentEl) return;
|
||||
parentEl = el;
|
||||
buildTreeDOM(processedTree, el);
|
||||
updateHighlight(selected.value);
|
||||
}
|
||||
|
||||
if (!selected.value) {
|
||||
|
||||
@@ -11,6 +11,15 @@ export function next() {
|
||||
return sleep(0);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {() => void} callback
|
||||
*/
|
||||
export function idle(callback) {
|
||||
("requestIdleCallback" in window ? requestIdleCallback : setTimeout)(
|
||||
callback,
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @template {(...args: any[]) => any} F
|
||||
|
||||
Reference in New Issue
Block a user