From 18b2a1c3b4194b36158a24a4646f578e66fcb6ea Mon Sep 17 00:00:00 2001 From: Paris Date: Thu, 10 Mar 2016 02:55:24 +0200 Subject: [PATCH] Handle drop event --- src/xterm.js | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/xterm.js b/src/xterm.js index 46f4a87f..c9fec907 100644 --- a/src/xterm.js +++ b/src/xterm.js @@ -418,6 +418,7 @@ Terminal.bindPaste(this); Terminal.bindKeys(this); Terminal.bindCopy(this); + Terminal.bindDrop(this); }; /** @@ -458,6 +459,17 @@ }; + Terminal.bindDrop = function (term) { + /* + * Do not perform the "drop" event. Altering the contents of the + * terminal with drag n drop is unwanted behavior. + */ + on(term.element, 'drop', function (ev) { + term.cancel(ev, true); + }); + }; + + /* * Insert the given row to the terminal or produce a new one * if no row argument is passed. Return the inserted row. @@ -512,6 +524,7 @@ this.element.classList.add('xterm-theme-' + this.theme); this.element.setAttribute('tabindex', 0); this.element.contentEditable = 'true'; + this.element.spellcheck = 'false'; /* * Create the container that will hold the lines of the terminal and then