summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Zallmann <tzallmann@gitlab.com>2017-10-05 15:14:33 +0200
committerTim Zallmann <tzallmann@gitlab.com>2017-10-05 15:14:33 +0200
commiteda9e6b65baece281f45255e25a263e895d36db5 (patch)
tree8b6bc074a26289392d2e6bec5a3345a2306e1646
parent8262cb2f4e9f366e99592859d6348f48da4a4d39 (diff)
downloadgitlab-ce-eda9e6b65baece281f45255e25a263e895d36db5.tar.gz
Fixed Linting Error + Error with Line Highlighter found in Test
-rw-r--r--app/assets/javascripts/line_highlighter.js2
-rw-r--r--app/assets/javascripts/repo/components/repo_preview.vue4
2 files changed, 3 insertions, 3 deletions
diff --git a/app/assets/javascripts/line_highlighter.js b/app/assets/javascripts/line_highlighter.js
index ef91d471639..a75d1a4b8d0 100644
--- a/app/assets/javascripts/line_highlighter.js
+++ b/app/assets/javascripts/line_highlighter.js
@@ -56,7 +56,7 @@ LineHighlighter.prototype.bindEvents = function() {
LineHighlighter.prototype.highlightHash = function(newHash) {
let range;
- if (newHash) this._hash = newHash;
+ if (newHash && typeof newHash === 'string') this._hash = newHash;
this.clearHighlight();
diff --git a/app/assets/javascripts/repo/components/repo_preview.vue b/app/assets/javascripts/repo/components/repo_preview.vue
index 514c7d9284c..04732489c5f 100644
--- a/app/assets/javascripts/repo/components/repo_preview.vue
+++ b/app/assets/javascripts/repo/components/repo_preview.vue
@@ -28,8 +28,8 @@ export default {
this.highlightFile();
});
},
- activeLine(e) {
- this.lineHighlighter.highlightHash('#L' + Store.activeLine);
+ activeLine() {
+ this.lineHighlighter.highlightHash(`#L${Store.activeLine}`);
},
},
};