Save visible state

This commit is contained in:
pythongosssss
2023-06-27 18:58:08 +01:00
parent 6abb79e808
commit 7534dd41dd
+16 -7
View File
@@ -94,6 +94,16 @@ app.registerExtension({
parent: document.body,
});
const imageList = $el("div.pysssss-image-feed-list");
const hideButton = $el("button.pysssss-image-feed-btn", {
textContent: "❌",
onclick: () => {
imageFeed.style.display = "none";
showButton.style.display = "unset";
saveVal("Visible", 0);
},
});
imageFeed.append(
$el("div.pysssss-image-feed-menu", [
$el(
@@ -153,22 +163,21 @@ app.registerExtension({
textContent: "Clear",
onclick: () => imageList.replaceChildren(),
}),
$el("button.pysssss-image-feed-btn", {
textContent: "❌",
onclick: () => {
imageFeed.style.display = "none";
showButton.style.display = "unset";
},
}),
hideButton,
]),
imageList
);
showButton.onclick = () => {
imageFeed.style.display = "block";
showButton.style.display = "none";
saveVal("Visible", 1);
};
document.querySelector(".comfy-settings-btn").after(showButton);
if (!+getVal("Visible", 1)) {
hideButton.onclick();
}
api.addEventListener("executed", ({ detail }) => {
if (detail?.output?.images) {
for (const src of detail.output.images) {