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:
Diffstat (limited to 'app/assets/javascripts/repository/pages/blob.vue')
-rw-r--r--app/assets/javascripts/repository/pages/blob.vue15
1 files changed, 15 insertions, 0 deletions
diff --git a/app/assets/javascripts/repository/pages/blob.vue b/app/assets/javascripts/repository/pages/blob.vue
index 2645b294096..c09e2133936 100644
--- a/app/assets/javascripts/repository/pages/blob.vue
+++ b/app/assets/javascripts/repository/pages/blob.vue
@@ -3,11 +3,25 @@
// https://gitlab.com/gitlab-org/gitlab/-/issues/323200
import BlobContentViewer from '../components/blob_content_viewer.vue';
+import { LIMITED_CONTAINER_WIDTH_CLASS } from '../constants';
export default {
components: {
BlobContentViewer,
},
+ beforeRouteEnter(to, from, next) {
+ next(({ $options }) => {
+ $options.limitedContainerElements.forEach((el) =>
+ el.classList.remove(LIMITED_CONTAINER_WIDTH_CLASS),
+ );
+ });
+ },
+ beforeRouteLeave(to, from, next) {
+ this.$options.limitedContainerElements.forEach((el) =>
+ el.classList.add(LIMITED_CONTAINER_WIDTH_CLASS),
+ );
+ next();
+ },
props: {
path: {
type: String,
@@ -18,6 +32,7 @@ export default {
required: true,
},
},
+ limitedContainerElements: document.querySelectorAll(`.${LIMITED_CONTAINER_WIDTH_CLASS}`),
};
</script>