diff --git a/static/js/components/app-main/index.js b/static/js/components/app-main/index.js index 8838def..15a56a6 100644 --- a/static/js/components/app-main/index.js +++ b/static/js/components/app-main/index.js @@ -66,7 +66,7 @@ function createXTerm(name, xtermNode){ fgColor: 'inherit', bgColor: 'transparent', onscreen: function (screen){ - if (Terminal.focus === this) { + if (this.isFocused()) { clearTimeout(timer); timer = setTimeout(function (){ diff --git a/static/js/terminal/lib/focused.js b/static/js/terminal/lib/focused.js index 0e0ed25..f8abcf4 100644 --- a/static/js/terminal/lib/focused.js +++ b/static/js/terminal/lib/focused.js @@ -7,6 +7,14 @@ module.exports = function (Terminal){ Terminal.focus = null; + /** + * isFocused + * @returns {boolean} + */ + Terminal.prototype.isFocused = function (){ + return Terminal.focus === this; + }; + /** * focus */