diff --git a/src/ui/components/controls/multipane.vue b/src/ui/components/controls/multipane.vue index 24f4c0e22a..1043d794d3 100644 --- a/src/ui/components/controls/multipane.vue +++ b/src/ui/components/controls/multipane.vue @@ -10,66 +10,142 @@ diff --git a/src/ui/components/controls/pane.vue b/src/ui/components/controls/pane.vue index 5e4f0d6689..e62d2e006f 100644 --- a/src/ui/components/controls/pane.vue +++ b/src/ui/components/controls/pane.vue @@ -1,13 +1,20 @@ @@ -20,13 +27,34 @@ export default { validator: function (value) { return ['before', 'after'].indexOf(value) !== -1; } + }, + collapsable: Boolean + }, + data() { + return { + collapsed: false } }, mounted() { this.type = this.$parent.type; + if (this.type === 'horizontal') { + this.styleProp = 'width'; + } else { + this.styleProp = 'height'; + } this.trackSize(); }, methods: { + toggleCollapse: function () { + this.collapsed = !this.collapsed; + if (this.collapsed) { + this.currentSize = this.$el.style[this.styleProp]; + this.$el.style[this.styleProp] = ''; + } else { + this.$el.style[this.styleProp] = this.currentSize; + delete this.currentSize; + } + }, trackSize: function() { if (this.type === 'vertical') { this.initial = this.$el.offsetHeight; @@ -50,14 +78,11 @@ export default { }, updatePosition: function (event) { let size = this.getNewSize(event); - if (this.type === 'horizontal') { - this.$el.style.width = size; - } else { - this.$el.style.height = size; - } + this.$el.style[this.styleProp] = size; }, start: function (event) { this.startPosition = this.getPosition(event); + this.trackSize(); document.body.addEventListener('mousemove', this.updatePosition); document.body.addEventListener('mouseup', this.end); }, diff --git a/src/ui/components/layout/Layout.vue b/src/ui/components/layout/Layout.vue index c7a6285683..e42aee0e74 100644 --- a/src/ui/components/layout/Layout.vue +++ b/src/ui/components/layout/Layout.vue @@ -1,27 +1,31 @@