} else {
/*
* Plain browser environment
- */
+ */
this.Xterm = xterm.call(this);
this.Terminal = this.Xterm; /* Backwards compatibility with term.js */
}
this.showCursor();
this.textarea.focus();
- this.emit('focus', {terminal: this});
};
Terminal.prototype.blur = function() {
if (this.sendFocus) {
this.send('\x1b[O');
}
-
- this.emit('blur', {terminal: this});
};
/**
this.textarea.setAttribute('autocapitalize', 'off');
this.textarea.setAttribute('spellcheck', 'false');
this.textarea.tabIndex = 0;
+ this.textarea.onfocus = function() {
+ self.emit('focus', {terminal: self});
+ }
+ this.textarea.onblur = function() {
+ self.emit('blur', {terminal: self});
+ }
this.helperContainer.appendChild(this.textarea);
for (; i < this.rows; i++) {
this.emit('keydown', ev);
this.emit('key', key, ev);
- this.showCursor();
+ this.showCursor();
this.handler(key);
return this.cancel(ev);
Terminal.cancel = cancel;
return Terminal;
-});
\ No newline at end of file
+});