|
@@ -32,9 +32,9 @@ export default {
|
|
|
|
|
|
methods: {
|
|
|
startResize (ev) {
|
|
|
- if (!this.resizeable || event.button !== 0) return
|
|
|
- event.stopPropagation()
|
|
|
- event.preventDefault()
|
|
|
+ if (!this.resizeable || ev.button !== 0) return
|
|
|
+ ev.stopPropagation()
|
|
|
+ ev.preventDefault()
|
|
|
this.state.resizing = true
|
|
|
// Grab delta
|
|
|
const parentRect = this.$el.getBoundingClientRect()
|
|
@@ -42,7 +42,7 @@ export default {
|
|
|
const delta = { x: ev.x - splitRect.left, y: ev.y - splitRect.top }
|
|
|
|
|
|
const drag = (ev) => {
|
|
|
- if (event.button !== 0) return
|
|
|
+ if (ev.button !== 0) return
|
|
|
const h = this.dir === 'horizontal'
|
|
|
var splitter = (h ? this.$el.children[1].clientWidth : this.$el.children[1].clientHeight) / 2
|
|
|
var splitSize = h
|
|
@@ -51,10 +51,10 @@ export default {
|
|
|
|
|
|
splitSize = Math.max(splitSize, 0)
|
|
|
this.state.split = splitSize + '%'
|
|
|
- this.$emit('onSplitResize', event, this.state.split)
|
|
|
+ this.$emit('onSplitResize', ev, this.state.split)
|
|
|
}
|
|
|
const drop = (ev) => {
|
|
|
- if (event.button !== 0) return
|
|
|
+ if (ev.button !== 0) return
|
|
|
this.state.resizing = false
|
|
|
document.removeEventListener('mousemove', drag)
|
|
|
document.removeEventListener('mouseup', drop)
|