mirror of
https://github.com/wavetermdev/xterm.js.git
synced 2026-08-05 13:43:48 -07:00
Merge pull request #84 from sourcelair/fix/terminal-focus-event
Fix emission of terminal focus&blur events
This commit is contained in:
+6
-2
@@ -401,7 +401,6 @@
|
||||
|
||||
this.showCursor();
|
||||
this.element.focus();
|
||||
this.emit('focus', {terminal: this});
|
||||
};
|
||||
|
||||
Terminal.prototype.blur = function() {
|
||||
@@ -417,7 +416,6 @@
|
||||
this.send('\x1b[O');
|
||||
}
|
||||
Terminal.focus = null;
|
||||
this.emit('blur', {terminal: this});
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -627,6 +625,12 @@
|
||||
this.element.classList.add('xterm-theme-' + this.theme);
|
||||
this.element.setAttribute('tabindex', 0);
|
||||
this.element.spellcheck = 'false';
|
||||
this.element.onfocus = function() {
|
||||
self.emit('focus', {terminal: this});
|
||||
};
|
||||
this.element.onblur = function() {
|
||||
self.emit('blur', {terminal: this});
|
||||
};
|
||||
|
||||
/*
|
||||
* Create the container that will hold the lines of the terminal and then
|
||||
|
||||
Reference in New Issue
Block a user