Commit e275fdd0 authored by Natalia Tepluhina's avatar Natalia Tepluhina

Merge branch 'fix-design-zoom' into 'master'

Reset design scale when design changes

See merge request gitlab-org/gitlab!44262
parents cbfe46da 65393806
......@@ -40,6 +40,8 @@ import { trackDesignDetailView } from '../../utils/tracking';
import { DESIGNS_ROUTE_NAME } from '../../router/constants';
import { ACTIVE_DISCUSSION_SOURCE_TYPES } from '../../constants';
const DEFAULT_SCALE = 1;
export default {
components: {
ApolloMutation,
......@@ -65,7 +67,7 @@ export default {
comment: '',
annotationCoordinates: null,
errorMessage: '',
scale: 1,
scale: DEFAULT_SCALE,
resolvedDiscussionsExpanded: false,
};
},
......@@ -157,6 +159,11 @@ export default {
beforeDestroy() {
Mousetrap.unbind('esc', this.closeDesign);
},
beforeRouteUpdate(to, from, next) {
// reset scale when the active design changes
this.scale = DEFAULT_SCALE;
next();
},
methods: {
addImageDiffNoteToStore(
store,
......
---
title: Fix design scale bug when navigating to a design after zooming
merge_request: 44262
author:
type: fixed
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment