listen for paste event on window.

This commit is contained in:
Christopher Jeffrey
2013-08-14 17:30:05 -05:00
parent 616b25bab7
commit 6ea891a159
+3 -1
View File
@@ -675,7 +675,9 @@ Terminal.prototype.open = function(parent) {
// This seems to work well for ctrl-V and middle-click,
// even without the contentEditable workaround.
on(this.element, 'paste', function(ev) {
// TODO Move this to initGlobal.
on(this.context, 'paste', function(ev) {
if (Terminal.focus !== self) return;
if (ev.clipboardData) {
self.send(ev.clipboardData.getData('text/plain'));
} else if (self.context.clipboardData) {