1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-12-24 17:10:29 +00:00

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
This commit is contained in:
Jeremy Ruston 2013-05-11 10:03:11 +01:00
parent f43e22f8e5
commit 15d1abf523

View File

@ -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;