From 25b1109af759baa489c63be2462d487793f553a4 Mon Sep 17 00:00:00 2001 From: nuintun Date: Thu, 26 Nov 2015 11:11:07 +0800 Subject: [PATCH] update files --- static/js/terminal/lib/cursor.js | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/static/js/terminal/lib/cursor.js b/static/js/terminal/lib/cursor.js index 65b87d9..9fdc441 100644 --- a/static/js/terminal/lib/cursor.js +++ b/static/js/terminal/lib/cursor.js @@ -14,6 +14,10 @@ module.exports = function (Terminal){ this.cursorState = 1; this.refresh(this.y, this.y); + + if (this.cursorBlink && this._blink && this._blinker) { + this._blink = setInterval(this._blinker, this.cursorBlinkSpeed); + } } }; @@ -28,8 +32,10 @@ module.exports = function (Terminal){ clearInterval(this._blink); - delete this._blink; - delete this._blinker; + if (!this.cursorBlink) { + delete this._blink; + delete this._blinker; + } this.refresh(this.y, this.y); } @@ -39,7 +45,7 @@ module.exports = function (Terminal){ * startBlink */ Terminal.prototype.startBlink = function (){ - if (this.cursor && this.cursorBlink && Terminal.focus === this) { + if (this.cursor && this._cursor && this.cursorBlink && Terminal.focus === this) { var context = this; clearInterval(this._blink);