Skip to content

Commit

Permalink
Merge changes from #828
Browse files Browse the repository at this point in the history
  • Loading branch information
mofux committed Aug 2, 2017
2 parents 5bc0ad8 + f134559 commit 106eda7
Showing 1 changed file with 5 additions and 14 deletions.
19 changes: 5 additions & 14 deletions src/xterm.js
Original file line number Diff line number Diff line change
Expand Up @@ -747,15 +747,6 @@ Terminal.prototype.open = function(parent, focus) {
this.focus();
}

on(this.element, 'click', function() {
var selection = document.getSelection(),
collapsed = selection.isCollapsed,
isRange = typeof collapsed == 'boolean' ? !collapsed : selection.type == 'Range';
if (!isRange) {
self.focus();
}
});

// Listen for mouse events and translate
// them into terminal mouse protocols.
this.bindMouse();
Expand Down Expand Up @@ -1026,17 +1017,17 @@ Terminal.prototype.bindMouse = function() {
}

on(el, 'mousedown', function(ev) {
// prevent the focus on the textarea from getting lost

// Prevent the focus on the textarea from getting lost
// and make sure we get focused on mousedown
ev.preventDefault();
self.focus();

if (!self.mouseEvents) return;

// send the button
sendButton(ev);

// ensure focus
self.focus();

// fix for odd bug
//if (self.vt200Mouse && !self.normalMouse) {
if (self.vt200Mouse) {
Expand Down Expand Up @@ -2205,7 +2196,7 @@ Terminal.prototype.ch = function(cur) {


/**
* Evaluate if the current erminal is the given argument.
* Evaluate if the current terminal is the given argument.
* @param {object} term The terminal to evaluate
*/
Terminal.prototype.is = function(term) {
Expand Down

0 comments on commit 106eda7

Please sign in to comment.