mirror of
https://github.com/nuintun/command-manager.git
synced 2025-06-08 12:14:03 +08:00
update files
This commit is contained in:
parent
6a9152ba96
commit
6ed273d781
@ -15,7 +15,7 @@ module.exports = function (Terminal){
|
|||||||
|
|
||||||
this.refresh(this.y, this.y);
|
this.refresh(this.y, this.y);
|
||||||
|
|
||||||
if (this.cursorBlink && this._blink && this._blinker) {
|
if (this.cursorBlink && !this._blink && this._blinker) {
|
||||||
this._blink = setInterval(this._blinker, this.cursorBlinkSpeed);
|
this._blink = setInterval(this._blinker, this.cursorBlinkSpeed);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -32,8 +32,9 @@ module.exports = function (Terminal){
|
|||||||
|
|
||||||
clearInterval(this._blink);
|
clearInterval(this._blink);
|
||||||
|
|
||||||
if (!this.cursorBlink) {
|
|
||||||
delete this._blink;
|
delete this._blink;
|
||||||
|
|
||||||
|
if (!this.cursorBlink) {
|
||||||
delete this._blinker;
|
delete this._blinker;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -45,19 +46,23 @@ module.exports = function (Terminal){
|
|||||||
* startBlink
|
* startBlink
|
||||||
*/
|
*/
|
||||||
Terminal.prototype.startBlink = function (){
|
Terminal.prototype.startBlink = function (){
|
||||||
if (this.cursor && this._cursor && this.cursorBlink && Terminal.focus === this) {
|
if (this.cursor && this.cursorBlink) {
|
||||||
var context = this;
|
var context = this;
|
||||||
|
|
||||||
clearInterval(this._blink);
|
clearInterval(this._blink);
|
||||||
|
|
||||||
this._blinker = function (){
|
this._blinker = function (){
|
||||||
|
if (context._cursor) {
|
||||||
context.cursorState ^= 1;
|
context.cursorState ^= 1;
|
||||||
|
|
||||||
context.refresh(context.y, context.y);
|
context.refresh(context.y, context.y);
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
if (this._cursor) {
|
||||||
this._blink = setInterval(this._blinker, this.cursorBlinkSpeed);
|
this._blink = setInterval(this._blinker, this.cursorBlinkSpeed);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
x
Reference in New Issue
Block a user