"ppocr/git@developer.sourcefind.cn:wangsen/paddle_dbnet.git" did not exist on "055f207fcfaf4c7c09ca1ea580429fb54263dcae"
Commit 0b6ba21f authored by pythongosssss's avatar pythongosssss
Browse files

Added save image menu item

parent aa2ddfab
...@@ -80,10 +80,23 @@ class ComfyApp { ...@@ -80,10 +80,23 @@ class ComfyApp {
img = this.imgs[this.overIndex]; img = this.imgs[this.overIndex];
} }
if (img) { if (img) {
options.unshift({ options.unshift(
content: "Open Image", {
callback: () => window.open(img.src, "_blank"), content: "Open Image",
}); callback: () => window.open(img.src, "_blank"),
},
{
content: "Save Image",
callback: () => {
const a = document.createElement("a");
a.href = img.src;
a.setAttribute("download", new URLSearchParams(new URL(img.src).search).get("filename"));
document.body.append(a);
a.click();
requestAnimationFrame(() => a.remove());
},
}
);
} }
} }
}; };
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment