Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Zallmann <tzallmann@gitlab.com>2017-10-05 12:54:46 +0300
committerTim Zallmann <tzallmann@gitlab.com>2017-10-05 12:54:46 +0300
commit8b16f1074ddb6ea6a5404d37409ab81002f28d52 (patch)
treeaca5904f189a8353fd56942b2c28a2bfbdab7923 /app/assets/javascripts/repo/components/repo_editor.vue
parent8d14a95638d7d6b52254b192b3e54296e22fddc3 (diff)
Refactored Highlighting mechanism
Diffstat (limited to 'app/assets/javascripts/repo/components/repo_editor.vue')
-rw-r--r--app/assets/javascripts/repo/components/repo_editor.vue14
1 files changed, 9 insertions, 5 deletions
diff --git a/app/assets/javascripts/repo/components/repo_editor.vue b/app/assets/javascripts/repo/components/repo_editor.vue
index f1acd339ad3..02d9c775046 100644
--- a/app/assets/javascripts/repo/components/repo_editor.vue
+++ b/app/assets/javascripts/repo/components/repo_editor.vue
@@ -64,11 +64,6 @@ const RepoEditor = {
if (e.target.element.classList.contains('line-numbers')) {
location.hash = `L${lineNumber}`;
Store.setActiveLine(lineNumber);
-
- Helper.monacoInstance.setPosition({
- lineNumber: this.activeLine,
- column: 1,
- });
}
},
},
@@ -101,6 +96,15 @@ const RepoEditor = {
this.setupEditor();
}
},
+
+ activeLine() {
+ if (Helper.monacoInstance) {
+ Helper.monacoInstance.setPosition({
+ lineNumber: this.activeLine,
+ column: 1,
+ });
+ }
+ },
},
computed: {
shouldHideEditor() {