kopia lustrzana https://github.com/miklobit/TiddlyWiki5
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 browsersprint-window-tiddler
rodzic
f43e22f8e5
commit
15d1abf523
|
@ -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;
|
||||
|
|
Ładowanie…
Reference in New Issue