2018-05-09 12:01:36 +05:30
|
|
|
<script>
|
2020-05-24 23:13:21 +05:30
|
|
|
import { mapActions } from 'vuex';
|
2018-05-09 12:01:36 +05:30
|
|
|
import PanelResizer from '~/vue_shared/components/panel_resizer.vue';
|
|
|
|
|
|
|
|
export default {
|
|
|
|
components: {
|
|
|
|
PanelResizer,
|
|
|
|
},
|
|
|
|
props: {
|
|
|
|
initialWidth: {
|
|
|
|
type: Number,
|
|
|
|
required: true,
|
|
|
|
},
|
|
|
|
minSize: {
|
|
|
|
type: Number,
|
|
|
|
required: false,
|
|
|
|
default: 340,
|
|
|
|
},
|
|
|
|
side: {
|
|
|
|
type: String,
|
|
|
|
required: true,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
data() {
|
|
|
|
return {
|
|
|
|
width: this.initialWidth,
|
|
|
|
};
|
|
|
|
},
|
|
|
|
computed: {
|
|
|
|
panelStyle() {
|
|
|
|
if (!this.collapsed) {
|
|
|
|
return {
|
|
|
|
width: `${this.width}px`,
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
return {};
|
|
|
|
},
|
|
|
|
},
|
|
|
|
methods: {
|
2020-05-24 23:13:21 +05:30
|
|
|
...mapActions(['setResizingStatus']),
|
2018-05-09 12:01:36 +05:30
|
|
|
},
|
|
|
|
maxSize: window.innerWidth / 2,
|
|
|
|
};
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<template>
|
2020-05-24 23:13:21 +05:30
|
|
|
<div :style="panelStyle" class="multi-file-commit-panel">
|
2018-05-09 12:01:36 +05:30
|
|
|
<slot></slot>
|
|
|
|
<panel-resizer
|
|
|
|
:size.sync="width"
|
|
|
|
:start-size="initialWidth"
|
|
|
|
:min-size="minSize"
|
|
|
|
:max-size="$options.maxSize"
|
2018-11-08 19:23:39 +05:30
|
|
|
:side="side === 'right' ? 'left' : 'right'"
|
2019-03-02 22:35:43 +05:30
|
|
|
@resize-start="setResizingStatus(true)"
|
|
|
|
@resize-end="setResizingStatus(false)"
|
2018-05-09 12:01:36 +05:30
|
|
|
/>
|
|
|
|
</div>
|
|
|
|
</template>
|