Commit 942488b8 authored by Filipa Lacerda's avatar Filipa Lacerda

Merge branch 'ide-sidebar-min-width' into 'master'

Changed IDE sidebar min width

Closes #44836

See merge request gitlab-org/gitlab-ce!18123
parents 1bca36b6 fc15ebaa
<script> <script>
import { mapActions, mapState } from 'vuex'; import { mapActions, mapState } from 'vuex';
import PanelResizer from '~/vue_shared/components/panel_resizer.vue'; import PanelResizer from '~/vue_shared/components/panel_resizer.vue';
export default { export default {
components: { components: {
PanelResizer, PanelResizer,
},
props: {
collapsible: {
type: Boolean,
required: true,
}, },
props: { initialWidth: {
collapsible: { type: Number,
type: Boolean, required: true,
required: true,
},
initialWidth: {
type: Number,
required: true,
},
minSize: {
type: Number,
required: false,
default: 200,
},
side: {
type: String,
required: true,
},
}, },
data() { minSize: {
return { type: Number,
width: this.initialWidth, required: false,
}; default: 340,
}, },
computed: { side: {
...mapState({ type: String,
collapsed(state) { required: true,
return state[`${this.side}PanelCollapsed`];
},
}),
panelStyle() {
if (!this.collapsed) {
return {
width: `${this.width}px`,
};
}
return {};
},
}, },
methods: { },
...mapActions([ data() {
'setPanelCollapsedStatus', return {
'setResizingStatus', width: this.initialWidth,
]), };
toggleFullbarCollapsed() { },
if (this.collapsed && this.collapsible) { computed: {
this.setPanelCollapsedStatus({ ...mapState({
side: this.side, collapsed(state) {
collapsed: !this.collapsed, return state[`${this.side}PanelCollapsed`];
});
}
}, },
}),
panelStyle() {
if (!this.collapsed) {
return {
width: `${this.width}px`,
};
}
return {};
},
},
methods: {
...mapActions(['setPanelCollapsedStatus', 'setResizingStatus']),
toggleFullbarCollapsed() {
if (this.collapsed && this.collapsible) {
this.setPanelCollapsedStatus({
side: this.side,
collapsed: !this.collapsed,
});
}
}, },
maxSize: (window.innerWidth / 2), },
}; maxSize: window.innerWidth / 2,
};
</script> </script>
<template> <template>
......
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