From 3ce8d76c8943ad424e1821819e48fffd60768ac5 Mon Sep 17 00:00:00 2001 From: Phill Campbell Date: Mon, 27 Apr 2015 18:49:12 +0100 Subject: [PATCH] Expose ClipboardEvent in editor paste event --- lib/ace/editor.js | 4 ++-- lib/ace/keyboard/textinput.js | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/ace/editor.js b/lib/ace/editor.js index f00f74f6..19d4b84e 100644 --- a/lib/ace/editor.js +++ b/lib/ace/editor.js @@ -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 if (this.$readOnly) return; - var e = {text: text}; + var e = {text: text, event: event}; this._signal("paste", e); text = e.text; if (!this.inMultiSelectMode || this.inVirtualSelectionMode) { diff --git a/lib/ace/keyboard/textinput.js b/lib/ace/keyboard/textinput.js index 0bd57eed..4a2bb72c 100644 --- a/lib/ace/keyboard/textinput.js +++ b/lib/ace/keyboard/textinput.js @@ -306,7 +306,7 @@ var TextInput = function(parentNode, host) { var data = handleClipboardData(e); if (typeof data == "string") { if (data) - host.onPaste(data); + host.onPaste(data, e); if (useragent.isIE) setTimeout(resetSelection); event.preventDefault(e);