2021-04-29 21:17:54 +05:30
|
|
|
<script>
|
|
|
|
// This file is in progress and behind a feature flag, please see the following issue for more:
|
|
|
|
// https://gitlab.com/gitlab-org/gitlab/-/issues/323200
|
|
|
|
|
|
|
|
import BlobContentViewer from '../components/blob_content_viewer.vue';
|
2021-11-11 11:23:49 +05:30
|
|
|
import { LIMITED_CONTAINER_WIDTH_CLASS } from '../constants';
|
2021-04-29 21:17:54 +05:30
|
|
|
|
|
|
|
export default {
|
|
|
|
components: {
|
|
|
|
BlobContentViewer,
|
|
|
|
},
|
2021-11-11 11:23:49 +05:30
|
|
|
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();
|
|
|
|
},
|
2021-04-29 21:17:54 +05:30
|
|
|
props: {
|
|
|
|
path: {
|
|
|
|
type: String,
|
|
|
|
required: true,
|
|
|
|
},
|
2021-06-08 01:23:25 +05:30
|
|
|
projectPath: {
|
|
|
|
type: String,
|
|
|
|
required: true,
|
|
|
|
},
|
2021-04-29 21:17:54 +05:30
|
|
|
},
|
2021-11-11 11:23:49 +05:30
|
|
|
limitedContainerElements: document.querySelectorAll(`.${LIMITED_CONTAINER_WIDTH_CLASS}`),
|
2021-04-29 21:17:54 +05:30
|
|
|
};
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<template>
|
2021-06-08 01:23:25 +05:30
|
|
|
<blob-content-viewer :path="path" :project-path="projectPath" />
|
2021-04-29 21:17:54 +05:30
|
|
|
</template>
|