diff options
-rw-r--r-- | app/assets/javascripts/line_highlighter.js | 2 | ||||
-rw-r--r-- | app/assets/javascripts/repo/components/repo_preview.vue | 4 |
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}`); }, }, }; |