diff options
Diffstat (limited to 'app/assets/javascripts/vue_shared/components/blob_viewers/rich_viewer.vue')
-rw-r--r-- | app/assets/javascripts/vue_shared/components/blob_viewers/rich_viewer.vue | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/app/assets/javascripts/vue_shared/components/blob_viewers/rich_viewer.vue b/app/assets/javascripts/vue_shared/components/blob_viewers/rich_viewer.vue index 27bdcc69120..b52752d7e2f 100644 --- a/app/assets/javascripts/vue_shared/components/blob_viewers/rich_viewer.vue +++ b/app/assets/javascripts/vue_shared/components/blob_viewers/rich_viewer.vue @@ -41,7 +41,6 @@ export default { mounted() { this.renderRemainingMarkup(); handleBlobRichViewer(this.$refs.content, this.type); - handleLocationHash(); }, methods: { optimizeMarkupRendering() { @@ -76,8 +75,7 @@ export default { * */ if (!this.isMarkup || !this.remainingContent.length) { - this.$emit(CONTENT_LOADED_EVENT); - this.isLoading = false; + this.onContentLoaded(); return; } @@ -89,11 +87,15 @@ export default { setTimeout(() => { fileContent.append(...content); if (nextChunkEnd < this.remainingContent.length) return; - this.$emit(CONTENT_LOADED_EVENT); - this.isLoading = false; + this.onContentLoaded(); }, i); } }, + onContentLoaded() { + this.$emit(CONTENT_LOADED_EVENT); + handleLocationHash(); + this.isLoading = false; + }, }, safeHtmlConfig: { ADD_TAGS: ['gl-emoji', 'copy-code'], |