1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-09-26 22:28:18 +00:00

Fix: add twEditor attribute to paste events handled by codemirror (#7281)

This commit is contained in:
Saq Imtiaz 2023-02-28 09:35:15 +01:00 committed by GitHub
parent 8d39ce95eb
commit 5bce35d90b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 1 deletions

View File

@ -259,7 +259,7 @@ DropZoneWidget.prototype.handlePasteEvent = function(event) {
} }
}; };
// Let the browser handle it if we're in a textarea or input box // Let the browser handle it if we're in a textarea or input box
if(["TEXTAREA","INPUT"].indexOf(event.target.tagName) == -1 && !event.target.isContentEditable) { if(["TEXTAREA","INPUT"].indexOf(event.target.tagName) == -1 && !event.target.isContentEditable && !event.twEditor) {
var self = this, var self = this,
items = event.clipboardData.items; items = event.clipboardData.items;
// Enumerate the clipboard items // Enumerate the clipboard items

View File

@ -220,9 +220,15 @@ function CodeMirrorEngine(options) {
} }
}); });
this.cm.on("paste",function(cm,event) { this.cm.on("paste",function(cm,event) {
event["twEditor"] = true;
self.widget.handlePasteEvent.call(self.widget,event); self.widget.handlePasteEvent.call(self.widget,event);
}); });
} else {
this.cm.on("paste",function(cm,event){
event["twEditor"] = true;
});
} }
;
} }
/* /*