diff options
Diffstat (limited to 'app/assets/javascripts')
3 files changed, 11 insertions, 2 deletions
diff --git a/app/assets/javascripts/repo/components/repo_commit_section.vue b/app/assets/javascripts/repo/components/repo_commit_section.vue index 1282828b504..4a852bfc024 100644 --- a/app/assets/javascripts/repo/components/repo_commit_section.vue +++ b/app/assets/javascripts/repo/components/repo_commit_section.vue @@ -52,6 +52,13 @@ export default { this.changedFiles = []; this.commitMessage = ''; this.editMode = false; + this.openedFiles = this.openedFiles.map((file) => { + const f = file; + f.changed = false; + + return f; + }); + Store.setViewToPreview(); window.scrollTo(0, 0); }, }, diff --git a/app/assets/javascripts/repo/components/repo_preview.vue b/app/assets/javascripts/repo/components/repo_preview.vue index 2200754cbef..ebd6e7c4cb6 100644 --- a/app/assets/javascripts/repo/components/repo_preview.vue +++ b/app/assets/javascripts/repo/components/repo_preview.vue @@ -14,7 +14,9 @@ export default { methods: { highlightFile() { - $(this.$el).find('.file-content').syntaxHighlight(); + this.$nextTick(() => { + $(this.$el).find('.file-content').syntaxHighlight(); + }); }, }, diff --git a/app/assets/javascripts/repo/components/repo_sidebar.vue b/app/assets/javascripts/repo/components/repo_sidebar.vue index 3414128526d..29bec8f75d9 100644 --- a/app/assets/javascripts/repo/components/repo_sidebar.vue +++ b/app/assets/javascripts/repo/components/repo_sidebar.vue @@ -27,7 +27,7 @@ export default { addPopEventListener() { window.addEventListener('popstate', () => { if (location.href.indexOf('#') > -1) return; - this.linkClicked({ + this.fileClicked({ url: location.href, }); }); |