mirror of
https://github.com/node-red/node-red.git
synced 2025-03-01 10:36:34 +00:00
Replace setTimeout with a listener
This commit is contained in:
parent
9a07fc03c6
commit
4788b81220
@ -676,10 +676,12 @@ RED.palette = (function() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
const collapse = JSON.parse(localStorage.getItem("palette-collapse") || "[]");
|
const collapse = JSON.parse(localStorage.getItem("palette-collapse") || "[]");
|
||||||
setTimeout(function () {
|
const callback = function () {
|
||||||
collapse.forEach((category) => categoryContainers[category]?.close());
|
collapse.forEach((category) => categoryContainers[category]?.close());
|
||||||
$("#red-ui-palette-search input").searchBox("value", (localStorage.getItem("palette-filter") || ""));
|
$("#red-ui-palette-search input").searchBox("value", (localStorage.getItem("palette-filter") || ""));
|
||||||
}, 1000);
|
RED.events.off("runtime-state", callback);
|
||||||
|
};
|
||||||
|
RED.events.on("runtime-state", callback);
|
||||||
}
|
}
|
||||||
function togglePalette(state) {
|
function togglePalette(state) {
|
||||||
if (!state) {
|
if (!state) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user