mirror of
https://git.datalinker.icu/comfyanonymous/ComfyUI
synced 2026-11-19 00:37:00 +08:00
escape exits out of modals
This commit is contained in:
parent
1fef809cc2
commit
d7b32f5dc6
@ -53,6 +53,15 @@ app.registerExtension({
|
||||
return;
|
||||
}
|
||||
|
||||
// Close out of modals using escape
|
||||
if (event.key === "Escape" || event.keyCode === 27) {
|
||||
const modals = document.querySelectorAll(".comfy-modal");
|
||||
const modal = Array.from(modals).find(modal => window.getComputedStyle(modal).getPropertyValue("display") !== "none");
|
||||
if (modal) {
|
||||
modal.style.display = "none";
|
||||
}
|
||||
}
|
||||
|
||||
const keyToButtonIdMap = {
|
||||
"q": "comfy-view-queue-button",
|
||||
81: "comfy-view-queue-button",
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user