mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2025-08-06 13:56:45 +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:
parent
f43e22f8e5
commit
15d1abf523
@ -92,17 +92,17 @@ TextEditor.prototype.render = function() {
|
|||||||
this.editWidget.events = [
|
this.editWidget.events = [
|
||||||
{name: "focus", handlerObject: this},
|
{name: "focus", handlerObject: this},
|
||||||
{name: "blur", handlerObject: this},
|
{name: "blur", handlerObject: this},
|
||||||
{name: "keyup", handlerObject: this}
|
{name: "input", handlerObject: this}
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
TextEditor.prototype.handleEvent = function(event) {
|
TextEditor.prototype.handleEvent = function(event) {
|
||||||
// Get the value of the field if it might have changed
|
// 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();
|
this.saveChanges();
|
||||||
}
|
}
|
||||||
// Fix the height of the textarea if required
|
// Fix the height of the textarea if required
|
||||||
if(["keyup","focus"].indexOf(event.type) !== -1) {
|
if(["input","focus"].indexOf(event.type) !== -1) {
|
||||||
this.fixHeight();
|
this.fixHeight();
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user