diff options
Diffstat (limited to 'app/assets/javascripts/ide/components/repo_file.vue')
-rw-r--r-- | app/assets/javascripts/ide/components/repo_file.vue | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/app/assets/javascripts/ide/components/repo_file.vue b/app/assets/javascripts/ide/components/repo_file.vue index dbdf0be2809..110eda83bb4 100644 --- a/app/assets/javascripts/ide/components/repo_file.vue +++ b/app/assets/javascripts/ide/components/repo_file.vue @@ -95,16 +95,18 @@ export default { return this.file.changed || this.file.tempFile || this.file.staged; }, }, + watch: { + 'file.active': function fileActiveWatch(active) { + if (this.file.type === 'blob' && active) { + this.scrollIntoView(); + } + }, + }, mounted() { if (this.hasPathAtCurrentRoute()) { this.scrollIntoView(true); } }, - updated() { - if (this.file.type === 'blob' && this.file.active) { - this.scrollIntoView(); - } - }, methods: { ...mapActions(['toggleTreeOpen']), clickFile() { |