fix reject shortcut and add + shortcut to dream
Signed-off-by: Victor Seiji Hariki <victorseijih@gmail.com>
This commit is contained in:
parent
6f99b15320
commit
ce78370eb3
1 changed files with 25 additions and 19 deletions
|
@ -167,6 +167,14 @@ const _generate = async (endpoint, request, bb) => {
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const makeMore = async () => {
|
||||||
|
let stopProgress = _monitorProgress(bb);
|
||||||
|
images.push(...(await _dream(endpoint, requestCopy)));
|
||||||
|
stopProgress();
|
||||||
|
|
||||||
|
imageindextxt.textContent = `${at + 1}/${images.length}`;
|
||||||
|
};
|
||||||
|
|
||||||
const discardImg = async () => {
|
const discardImg = async () => {
|
||||||
clean();
|
clean();
|
||||||
};
|
};
|
||||||
|
@ -184,20 +192,24 @@ const _generate = async (endpoint, request, bb) => {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
switch (evn.code) {
|
switch (evn.key) {
|
||||||
case "ArrowRight":
|
case "+":
|
||||||
nextImg();
|
makeMore();
|
||||||
break;
|
|
||||||
case "ArrowLeft":
|
|
||||||
prevImg();
|
|
||||||
break;
|
|
||||||
case "Enter":
|
|
||||||
applyImg();
|
|
||||||
break;
|
|
||||||
case "Esc":
|
|
||||||
applyImg();
|
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
switch (evn.code) {
|
||||||
|
case "ArrowRight":
|
||||||
|
nextImg();
|
||||||
|
break;
|
||||||
|
case "ArrowLeft":
|
||||||
|
prevImg();
|
||||||
|
break;
|
||||||
|
case "Escape":
|
||||||
|
applyImg();
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -254,13 +266,7 @@ const _generate = async (endpoint, request, bb) => {
|
||||||
const morebtn = document.createElement("button");
|
const morebtn = document.createElement("button");
|
||||||
morebtn.textContent = "+";
|
morebtn.textContent = "+";
|
||||||
morebtn.title = "Generate More";
|
morebtn.title = "Generate More";
|
||||||
morebtn.addEventListener("click", async () => {
|
morebtn.addEventListener("click", makeMore);
|
||||||
let stopProgress = _monitorProgress(bb);
|
|
||||||
images.push(...(await _dream(endpoint, requestCopy)));
|
|
||||||
stopProgress();
|
|
||||||
|
|
||||||
imageindextxt.textContent = `${at + 1}/${images.length}`;
|
|
||||||
});
|
|
||||||
imageSelectMenu.appendChild(morebtn);
|
imageSelectMenu.appendChild(morebtn);
|
||||||
|
|
||||||
const acceptbtn = document.createElement("button");
|
const acceptbtn = document.createElement("button");
|
||||||
|
|
Loading…
Reference in a new issue