diff --git a/web/editor.js b/web/editor.js
index d5d0309e7..9b30ac119 100644
--- a/web/editor.js
+++ b/web/editor.js
@@ -28,6 +28,14 @@ function saveNow(keepFocus) {
}
}
+function triggerKeyTimer() {
+ clearChangeTimer();
+ changeTimer = setTimeout(function () {
+ updateButtonState();
+ saveField("key");
+ }, 600);
+}
+
function onKey() {
// esc clears focus, allowing dialog to close
if (window.event.which === 27) {
@@ -41,11 +49,7 @@ function onKey() {
focusPrevious();
return;
}
- clearChangeTimer();
- changeTimer = setTimeout(function () {
- updateButtonState();
- saveField("key");
- }, 600);
+ triggerKeyTimer();
}
function insertNewline() {
@@ -82,10 +86,14 @@ function inPreEnvironment() {
return window.getComputedStyle(n).whiteSpace.startsWith("pre");
}
-function checkForEmptyField() {
+function onInput() {
+ // empty field?
if (currentField.innerHTML === "") {
currentField.innerHTML = "
";
}
+
+ // make sure IME changes get saved
+ triggerKeyTimer();
}
function updateButtonState() {
@@ -288,7 +296,7 @@ function setFields(fields) {
f = "
";
}
txt += "