inspector update
This commit is contained in:
parent
684a89460f
commit
1f7dbf21e0
1 changed files with 15 additions and 0 deletions
|
|
@ -323,6 +323,9 @@
|
|||
function show() {
|
||||
if (open) return;
|
||||
open = true;
|
||||
try {
|
||||
sessionStorage.setItem("blissInspectorOpen", "1");
|
||||
} catch (_) {}
|
||||
document.documentElement.classList.add("bliss-inspector-open");
|
||||
root = document.createElement("div");
|
||||
root.id = "bliss-inspector-root";
|
||||
|
|
@ -336,6 +339,9 @@
|
|||
|
||||
function hide() {
|
||||
open = false;
|
||||
try {
|
||||
sessionStorage.removeItem("blissInspectorOpen");
|
||||
} catch (_) {}
|
||||
document.documentElement.classList.remove("bliss-inspector-open");
|
||||
root?.remove();
|
||||
root = null;
|
||||
|
|
@ -376,6 +382,15 @@
|
|||
"position:fixed;right:.5rem;bottom:.5rem;z-index:2147483647;border:0;background:white;border-radius:999px;padding:.45rem;font-size:1.25rem;cursor:pointer;box-shadow:0 2px 8px #0004";
|
||||
trigger.onclick = () => (open ? hide() : show());
|
||||
document.body.appendChild(trigger);
|
||||
|
||||
// A "Save & View" jump navigates the whole page to see a route live;
|
||||
// pick the inspector back up here so that hop doesn't feel like closing
|
||||
// it. slideout.eta separately restores whatever editor pane was open.
|
||||
let wasOpen = false;
|
||||
try {
|
||||
wasOpen = sessionStorage.getItem("blissInspectorOpen") === "1";
|
||||
} catch (_) {}
|
||||
if (wasOpen) show();
|
||||
});
|
||||
|
||||
document.addEventListener("bliss:highlight", (event) =>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue