mirror of
https://github.com/nuintun/command-manager.git
synced 2025-06-09 04:34:04 +08:00
31 lines
507 B
JavaScript
31 lines
507 B
JavaScript
/**
|
|
* Created by nuintun on 2015/11/25.
|
|
*/
|
|
|
|
'use strict';
|
|
|
|
module.exports = function (Terminal){
|
|
Terminal.focus = null;
|
|
|
|
Terminal.prototype.focus = function (){
|
|
if (Terminal.focus === this) return;
|
|
|
|
if (Terminal.focus) {
|
|
Terminal.focus.blur();
|
|
}
|
|
|
|
this.showCursor();
|
|
|
|
Terminal.focus = this;
|
|
};
|
|
|
|
Terminal.prototype.blur = function (){
|
|
if (Terminal.focus !== this) return;
|
|
|
|
this.cursorState = 0;
|
|
this.refresh(this.y, this.y);
|
|
|
|
Terminal.focus = null;
|
|
};
|
|
};
|