diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-10-22 12:08:26 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-10-22 12:08:26 +0300 |
commit | 9dab4d7b6492628eb9222f14954fdd8889bd6e34 (patch) | |
tree | ae7723aff502efd04449be1692b4488cbd198de7 /app/assets/javascripts/design_management/pages | |
parent | f0fa9f7acf4c23f9a9fb4903fd7c41678a20c028 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/assets/javascripts/design_management/pages')
-rw-r--r-- | app/assets/javascripts/design_management/pages/design/index.vue | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/app/assets/javascripts/design_management/pages/design/index.vue b/app/assets/javascripts/design_management/pages/design/index.vue index 6a96b06dcd8..642d51fbc7a 100644 --- a/app/assets/javascripts/design_management/pages/design/index.vue +++ b/app/assets/javascripts/design_management/pages/design/index.vue @@ -21,6 +21,7 @@ import { updateImageDiffNoteOptimisticResponse, toDiffNoteGid, extractDesignNoteId, + getPageLayoutElement, } from '../../utils/design_management_utils'; import { updateStoreAfterAddImageDiffNote, @@ -38,7 +39,7 @@ import { } from '../../utils/error_messages'; import { trackDesignDetailView } from '../../utils/tracking'; import { DESIGNS_ROUTE_NAME } from '../../router/constants'; -import { ACTIVE_DISCUSSION_SOURCE_TYPES } from '../../constants'; +import { ACTIVE_DISCUSSION_SOURCE_TYPES, DESIGN_DETAIL_LAYOUT_CLASSLIST } from '../../constants'; const DEFAULT_SCALE = 1; @@ -300,6 +301,22 @@ export default { this.resolvedDiscussionsExpanded = !this.resolvedDiscussionsExpanded; }, }, + beforeRouteEnter(to, from, next) { + const pageEl = getPageLayoutElement(); + if (pageEl) { + pageEl.classList.add(...DESIGN_DETAIL_LAYOUT_CLASSLIST); + } + + next(); + }, + beforeRouteLeave(to, from, next) { + const pageEl = getPageLayoutElement(); + if (pageEl) { + pageEl.classList.remove(...DESIGN_DETAIL_LAYOUT_CLASSLIST); + } + + next(); + }, createImageDiffNoteMutation, DESIGNS_ROUTE_NAME, }; |