Merge pull request #2472 from ph1ll/master
Expose ClipboardEvent in editor paste event
This commit is contained in:
commit
32cb8c6b0e
2 changed files with 3 additions and 3 deletions
|
|
@ -920,12 +920,12 @@ var Editor = function(renderer, session) {
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
**/
|
**/
|
||||||
this.onPaste = function(text) {
|
this.onPaste = function(text, event) {
|
||||||
// todo this should change when paste becomes a command
|
// todo this should change when paste becomes a command
|
||||||
if (this.$readOnly)
|
if (this.$readOnly)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
var e = {text: text};
|
var e = {text: text, event: event};
|
||||||
this._signal("paste", e);
|
this._signal("paste", e);
|
||||||
text = e.text;
|
text = e.text;
|
||||||
if (!this.inMultiSelectMode || this.inVirtualSelectionMode) {
|
if (!this.inMultiSelectMode || this.inVirtualSelectionMode) {
|
||||||
|
|
|
||||||
|
|
@ -306,7 +306,7 @@ var TextInput = function(parentNode, host) {
|
||||||
var data = handleClipboardData(e);
|
var data = handleClipboardData(e);
|
||||||
if (typeof data == "string") {
|
if (typeof data == "string") {
|
||||||
if (data)
|
if (data)
|
||||||
host.onPaste(data);
|
host.onPaste(data, e);
|
||||||
if (useragent.isIE)
|
if (useragent.isIE)
|
||||||
setTimeout(resetSelection);
|
setTimeout(resetSelection);
|
||||||
event.preventDefault(e);
|
event.preventDefault(e);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue