]> git.proxmox.com Git - mirror_xterm.js.git/commitdiff
Handle drop event
authorParis <paris@sourcelair.com>
Thu, 10 Mar 2016 00:55:24 +0000 (02:55 +0200)
committerParis <paris@sourcelair.com>
Thu, 10 Mar 2016 00:55:24 +0000 (02:55 +0200)
src/xterm.js

index 46f4a87fbbba8fa914d07da863e99d184fb912dc..c9fec907d9e8c32aaf6079b0c2678fee2c375177 100644 (file)
       Terminal.bindPaste(this);
       Terminal.bindKeys(this);
       Terminal.bindCopy(this);
+      Terminal.bindDrop(this);
     };
 
     /**
     };
 
 
+    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.
       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