summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNick Thomas <nick@gitlab.com>2018-03-01 17:53:47 +0000
committerNick Thomas <nick@gitlab.com>2018-03-07 00:04:20 +0000
commit6931dd7f18b09319d9f4acde77ff42d1af355031 (patch)
tree7b16d8b47960e9d383789e17deb39b7d2938eece
parentff00cfe45c744393de5bfcafdcfbd12108cc664f (diff)
downloadgitlab-ce-6931dd7f18b09319d9f4acde77ff42d1af355031.tar.gz
Fix a JS bug in the websocket terminal
-rw-r--r--app/assets/javascripts/terminal/terminal.js10
1 files changed, 8 insertions, 2 deletions
diff --git a/app/assets/javascripts/terminal/terminal.js b/app/assets/javascripts/terminal/terminal.js
index 6b9422b1816..904b0093f7b 100644
--- a/app/assets/javascripts/terminal/terminal.js
+++ b/app/assets/javascripts/terminal/terminal.js
@@ -6,8 +6,14 @@
constructor(options) {
this.options = options || {};
- this.options.cursorBlink = options.cursorBlink || true;
- this.options.screenKeys = options.screenKeys || true;
+ if (!Object.prototype.hasOwnProperty.call(this.options, 'cursorBlink')) {
+ this.options.cursorBlink = true;
+ }
+
+ if (!Object.prototype.hasOwnProperty.call(this.options, 'screenKeys')) {
+ this.options.screenKeys = true;
+ }
+
this.container = document.querySelector(options.selector);
this.setSocketUrl();