From 487f3bed0c78180804dc1fa3e227936c6252feff Mon Sep 17 00:00:00 2001 From: Victor Seiji Hariki Date: Tue, 10 Jan 2023 14:30:09 -0300 Subject: [PATCH] implements #164 Signed-off-by: Victor Seiji Hariki --- index.html | 2 +- js/ui/tool/dream.js | 14 ++++++++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/index.html b/index.html index 2494d65..aa35115 100644 --- a/index.html +++ b/index.html @@ -371,7 +371,7 @@ src="js/ui/tool/generic.js?v=2bcd36d" type="text/javascript"> - + diff --git a/js/ui/tool/dream.js b/js/ui/tool/dream.js index daa0670..3713d0a 100644 --- a/js/ui/tool/dream.js +++ b/js/ui/tool/dream.js @@ -775,6 +775,20 @@ const _generate = async (endpoint, request, bb, options = {}) => { }); imageSelectMenu.appendChild(resourcebtn); + const deletebtn = document.createElement("button"); + deletebtn.textContent = "D"; + deletebtn.title = "Delete Image"; + deletebtn.addEventListener("click", async () => { + images.splice(at, 1); + seeds.splice(at, 1); + + at = Math.min(at, images.length - 1); + + imageindextxt.textContent = `${at}/${images.length - 1}`; + redraw(); + }); + imageSelectMenu.appendChild(deletebtn); + const savebtn = document.createElement("button"); savebtn.textContent = "S"; savebtn.title = "Download image to computer";