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:
authorGitLab Bot <gitlab-bot@gitlab.com>2022-07-22 15:10:03 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2022-07-22 15:10:03 +0300
commit74b99c4264411703dedaf2d24cec2e6a5de6337d (patch)
treea36ce9dccc64043c37f8cb8ace0236d323ea44bc /app/assets/javascripts/repository
parent2763994b8f9e44c8ee9bd7197622e6bcba00a4db (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/assets/javascripts/repository')
-rw-r--r--app/assets/javascripts/repository/components/blob_content_viewer.vue17
1 files changed, 10 insertions, 7 deletions
diff --git a/app/assets/javascripts/repository/components/blob_content_viewer.vue b/app/assets/javascripts/repository/components/blob_content_viewer.vue
index bf4f19504f0..f6d370fb450 100644
--- a/app/assets/javascripts/repository/components/blob_content_viewer.vue
+++ b/app/assets/javascripts/repository/components/blob_content_viewer.vue
@@ -189,15 +189,10 @@ export default {
axios
.get(`${this.blobInfo.webPath}?format=json&viewer=${type}`)
.then(async ({ data: { html, binary } }) => {
- if (type === SIMPLE_BLOB_VIEWER) {
- this.isRenderingLegacyTextViewer = true;
+ this.isRenderingLegacyTextViewer = true;
+ if (type === SIMPLE_BLOB_VIEWER) {
this.legacySimpleViewer = html;
-
- window.requestIdleCallback(() => {
- this.isRenderingLegacyTextViewer = false;
- new LineHighlighter(); // eslint-disable-line no-new
- });
} else {
this.legacyRichViewer = html;
}
@@ -205,6 +200,14 @@ export default {
this.isBinary = binary;
this.isLoadingLegacyViewer = false;
+ window.requestIdleCallback(() => {
+ this.isRenderingLegacyTextViewer = false;
+
+ if (type === SIMPLE_BLOB_VIEWER) {
+ new LineHighlighter(); // eslint-disable-line no-new
+ }
+ });
+
await this.$nextTick();
handleLocationHash(); // Ensures that we scroll to the hash when async content is loaded
})