From 15d1abf5231f3e005e46af16a480614353c0a497 Mon Sep 17 00:00:00 2001 From: Jeremy Ruston Date: Sat, 11 May 2013 10:03:11 +0100 Subject: [PATCH] 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 --- core/modules/widgets/edit/editors/texteditor.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/core/modules/widgets/edit/editors/texteditor.js b/core/modules/widgets/edit/editors/texteditor.js index 5a417201c..36ed98f75 100644 --- a/core/modules/widgets/edit/editors/texteditor.js +++ b/core/modules/widgets/edit/editors/texteditor.js @@ -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;