mirror of
https://github.com/lovasoa/whitebophir
synced 2024-11-10 14:34:20 +00:00
Close text edition field when "escape" is pressed
This commit is contained in:
parent
205a17902b
commit
3151651f45
2 changed files with 3 additions and 2 deletions
|
@ -58,7 +58,6 @@ Tools.HTML = {
|
|||
elem.getElementsByClassName("tool-name")[0].textContent = toolName;
|
||||
elem.getElementsByClassName("tool-icon")[0].textContent = toolIcon;
|
||||
elem.title =
|
||||
Tools.i18n.t("Tool") + ": " +
|
||||
Tools.i18n.t(toolName) + " (" +
|
||||
Tools.i18n.t("keyboard shortcut") + ": " +
|
||||
toolShortcut + ")";
|
||||
|
|
|
@ -100,9 +100,11 @@
|
|||
}
|
||||
|
||||
function textChangeHandler(evt) {
|
||||
if (evt.which === 13) {
|
||||
if (evt.which === 13) { // enter
|
||||
curText.y += 1.5 * curText.size;
|
||||
return drawCurText();
|
||||
} else if (evt.which === 27) { // escape
|
||||
stopEdit();
|
||||
}
|
||||
if (performance.now() - curText.lastSending > 100) {
|
||||
if (curText.sentText !== input.value) {
|
||||
|
|
Loading…
Reference in a new issue