forked from extern/easydiffusion
Merge pull request #1098 from patriceac/patch-63
Fix key presses in the image editor
This commit is contained in:
commit
8ab445bb31
@ -512,13 +512,13 @@ class ImageEditor {
|
|||||||
}
|
}
|
||||||
show() {
|
show() {
|
||||||
this.popup.classList.add("active")
|
this.popup.classList.add("active")
|
||||||
document.addEventListener("keydown", this.keyHandlerBound)
|
document.addEventListener("keydown", this.keyHandlerBound, true)
|
||||||
document.addEventListener("keyup", this.keyHandlerBound)
|
document.addEventListener("keyup", this.keyHandlerBound, true)
|
||||||
}
|
}
|
||||||
hide() {
|
hide() {
|
||||||
this.popup.classList.remove("active")
|
this.popup.classList.remove("active")
|
||||||
document.removeEventListener("keydown", this.keyHandlerBound)
|
document.removeEventListener("keydown", this.keyHandlerBound, true)
|
||||||
document.removeEventListener("keyup", this.keyHandlerBound)
|
document.removeEventListener("keyup", this.keyHandlerBound, true)
|
||||||
}
|
}
|
||||||
setSize(width, height) {
|
setSize(width, height) {
|
||||||
if (width == this.width && height == this.height) {
|
if (width == this.width && height == this.height) {
|
||||||
@ -672,12 +672,18 @@ class ImageEditor {
|
|||||||
else {
|
else {
|
||||||
this.history.redo()
|
this.history.redo()
|
||||||
}
|
}
|
||||||
|
event.stopPropagation();
|
||||||
|
event.preventDefault();
|
||||||
}
|
}
|
||||||
if (event.key == "y" && event.ctrlKey) {
|
if (event.key == "y" && event.ctrlKey) {
|
||||||
this.history.redo()
|
this.history.redo()
|
||||||
|
event.stopPropagation();
|
||||||
|
event.preventDefault();
|
||||||
}
|
}
|
||||||
if (event.key === "Escape") {
|
if (event.key === "Escape") {
|
||||||
this.hide()
|
this.hide()
|
||||||
|
event.stopPropagation();
|
||||||
|
event.preventDefault();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user