mirror of
https://github.com/comfyanonymous/ComfyUI.git
synced 2026-01-23 21:00:16 +08:00
Update imageFeed.js
Remove disable deleteAll button, remove debugger, add tooltips to buttons
This commit is contained in:
parent
a95f4e9757
commit
5cf4d65c53
@ -169,10 +169,11 @@ app.registerExtension({
|
|||||||
top:"0px"
|
top:"0px"
|
||||||
});
|
});
|
||||||
imageList.append(menu);
|
imageList.append(menu);
|
||||||
function makeButton(text, style) {
|
function makeButton(text, style, title) {
|
||||||
const btn = document.createElement("button");
|
const btn = document.createElement("button");
|
||||||
btn.type = "button";
|
btn.type = "button";
|
||||||
btn.textContent = text;
|
btn.textContent = text;
|
||||||
|
btn.title = title;
|
||||||
Object.assign(btn.style, {
|
Object.assign(btn.style, {
|
||||||
...style,
|
...style,
|
||||||
height: "20px",
|
height: "20px",
|
||||||
@ -191,7 +192,8 @@ app.registerExtension({
|
|||||||
textIndent: "-4px",
|
textIndent: "-4px",
|
||||||
top: "5px",
|
top: "5px",
|
||||||
right: "5px",
|
right: "5px",
|
||||||
});
|
}, "Hide the image drawer (Open Drawer button will be displayed on main floating menu)"
|
||||||
|
);
|
||||||
closeButton.onclick = () => {
|
closeButton.onclick = () => {
|
||||||
imageList.style.display = "none";
|
imageList.style.display = "none";
|
||||||
showButton.style.display = "unset";
|
showButton.style.display = "unset";
|
||||||
@ -200,7 +202,8 @@ app.registerExtension({
|
|||||||
const clearButton = makeButton("✖ Clear", {
|
const clearButton = makeButton("✖ Clear", {
|
||||||
top: "30px",
|
top: "30px",
|
||||||
right: "5px",
|
right: "5px",
|
||||||
});
|
}, "Clears all items displayed in image drawer (This won't delete anything, refreshing the page will reload from Output)"
|
||||||
|
);
|
||||||
clearButton.onclick = () => {
|
clearButton.onclick = () => {
|
||||||
allImages = []
|
allImages = []
|
||||||
imageList.replaceChildren(menu, resizeHandle);
|
imageList.replaceChildren(menu, resizeHandle);
|
||||||
@ -208,11 +211,11 @@ app.registerExtension({
|
|||||||
const deleteAllButton = makeButton("🗑️ Delete", {
|
const deleteAllButton = makeButton("🗑️ Delete", {
|
||||||
top: "55px",
|
top: "55px",
|
||||||
right: "5px",
|
right: "5px",
|
||||||
});
|
}, "Delete all items displayed in image drawer (This won't delete the entire output folder)"
|
||||||
|
);
|
||||||
deleteAllButton.onclick = () => {
|
deleteAllButton.onclick = () => {
|
||||||
const confirmDelete = confirm("Are you sure you want to delete all images in the drawer?");
|
const confirmDelete = confirm("Are you sure you want to delete all images in the drawer?");
|
||||||
if (confirmDelete) {
|
if (confirmDelete) {
|
||||||
debugger;
|
|
||||||
api.deleteAllImages(allImages.map(item => item.filename));
|
api.deleteAllImages(allImages.map(item => item.filename));
|
||||||
allImages = []
|
allImages = []
|
||||||
imageList.replaceChildren(menu, resizeHandle);
|
imageList.replaceChildren(menu, resizeHandle);
|
||||||
@ -228,11 +231,7 @@ app.registerExtension({
|
|||||||
var detail = {output: output}
|
var detail = {output: output}
|
||||||
loadImages(detail);
|
loadImages(detail);
|
||||||
}
|
}
|
||||||
else {
|
|
||||||
deleteAllButton.setAttribute("disabled", true);
|
|
||||||
}
|
|
||||||
} catch(err){
|
} catch(err){
|
||||||
deleteAllButton.setAttribute("disabled", true);
|
|
||||||
console.error(err);
|
console.error(err);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user