Fix problem with context-menu paste not triggering saving of edits

We'll use the input event to detect changes, which is reliable but
doesn't work on older browsers
print-window-tiddler
Jeremy Ruston 2013-05-11 10:03:11 +01:00
rodzic f43e22f8e5
commit 15d1abf523
1 zmienionych plików z 3 dodań i 3 usunięć

Wyświetl plik

@ -92,17 +92,17 @@ TextEditor.prototype.render = function() {
this.editWidget.events = [
{name: "focus", handlerObject: this},
{name: "blur", handlerObject: this},
{name: "keyup", handlerObject: this}
{name: "input", handlerObject: this}
];
};
TextEditor.prototype.handleEvent = function(event) {
// Get the value of the field if it might have changed
if(["keyup","focus","blur"].indexOf(event.type) !== -1) {
if(["input","focus","blur"].indexOf(event.type) !== -1) {
this.saveChanges();
}
// Fix the height of the textarea if required
if(["keyup","focus"].indexOf(event.type) !== -1) {
if(["input","focus"].indexOf(event.type) !== -1) {
this.fixHeight();
}
return true;