mirror of
https://github.com/wavetermdev/xterm.js.git
synced 2026-08-05 13:43:48 -07:00
Handle drop event
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user