Skip to content

Commit

Permalink
Merge pull request #1 from shishirraven/patch-3
Browse files Browse the repository at this point in the history
Added sizeInPixel for resize and resized events
  • Loading branch information
rexhent authored Jul 7, 2024
2 parents dfcb806 + 80e3f22 commit be9267c
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/components/splitpanes/splitpanes.vue
Original file line number Diff line number Diff line change
Expand Up @@ -93,13 +93,16 @@ export default {
event.preventDefault()
this.touch.dragging = true
this.calculatePanesSize(this.getCurrentMouseDrag(event))
this.$emit('resize', this.panes.map(pane => ({ min: pane.min, max: pane.max, size: pane.size })))
var containerSize = this.container[this.horizontal ? 'clientHeight' : 'clientWidth']
this.$emit('resize', this.panes.map(pane => ({ min: pane.min, max: pane.max, size: pane.size, sizeInPixel: (containerSize/100)*pane.size })))
}
},
onMouseUp () {
if (this.touch.dragging) {
this.$emit('resized', this.panes.map(pane => ({ min: pane.min, max: pane.max, size: pane.size })))
var containerSize = this.container[this.horizontal ? 'clientHeight' : 'clientWidth']
this.$emit('resized', this.panes.map(pane => ({ min: pane.min, max: pane.max, size: pane.size, sizeInPixel: (containerSize/100)*pane.size })))
}
this.touch.mouseDown = false
// Keep dragging flag until click event is finished (click happens immediately after mouseup)
Expand Down

0 comments on commit be9267c

Please sign in to comment.