mirror of
https://github.com/easydiffusion/easydiffusion.git
synced 2024-11-22 16:23:28 +01:00
Hide Image buttons hides task (#854)
* hide task when all images are hidden * Update main.css * remove console logs * remove another console log * Update main.js * Update main.js
This commit is contained in:
parent
1cc09cbe5f
commit
f2f3ed71d4
@ -1204,3 +1204,7 @@ body.wait-pause {
|
||||
.jconfirm.jconfirm-modern .jconfirm-box {
|
||||
background-color: var(--background-color1);
|
||||
}
|
||||
|
||||
.displayNone {
|
||||
display:none !important;
|
||||
}
|
||||
|
@ -279,9 +279,21 @@ function showImages(reqBody, res, outputContainer, livePreview) {
|
||||
imageElem.setAttribute('data-guidance', imageGuidanceScale)
|
||||
|
||||
const imageRemoveBtn = imageItemElem.querySelector('.imgPreviewItemClearBtn')
|
||||
let parentTaskContainer = imageRemoveBtn.closest('.imageTaskContainer')
|
||||
imageRemoveBtn.addEventListener('click', (e) => {
|
||||
console.log(e)
|
||||
shiftOrConfirm(e, "Remove the image from the results?", () => { imageItemElem.style.display = 'none' })
|
||||
shiftOrConfirm(e, "Remove the image from the results?", () => {
|
||||
imageItemElem.style.display = 'none'
|
||||
let allHidden = true;
|
||||
let children = parentTaskContainer.querySelectorAll('.imgItem');
|
||||
for(let x = 0; x < children.length; x++) {
|
||||
let child = children[x];
|
||||
if(child.style.display != "none") {
|
||||
allHidden = false;
|
||||
}
|
||||
}
|
||||
if(allHidden === true) {parentTaskContainer.classList.add("displayNone")}
|
||||
})
|
||||
})
|
||||
|
||||
const imageInfo = imageItemElem.querySelector('.imgItemInfo')
|
||||
|
Loading…
Reference in New Issue
Block a user