Skip to content
Snippets Groups Projects
Commit 3cc27a77 authored by Adam Procter's avatar Adam Procter
Browse files

forgot OtherNodes

z-index updated
parent f2c2ad57
No related branches found
No related tags found
No related merge requests found
No preview for this file type
......@@ -11,7 +11,7 @@
:y="value.y_pos"
:z="value.z_index"
:scale="scale"
@activated="onActivated(nodes.node_id)"
@activated="onActivated(nodes.node_id, value.z_index)"
:draggable="false"
:resizable="false"
@dragging="onDrag"
......@@ -122,7 +122,7 @@
:y="value.y_pos"
:z="value.z_index"
:scale="scale"
@activated="onActivated(nodes.node_id)"
@activated="onActivated(nodes.node_id, value.z_index)"
@dragging="onDrag"
@resizing="onResize"
@dragstop="onDragstop"
......@@ -312,14 +312,30 @@ export default {
// this.$options.positionsArray = this.positions_filtered
// this.$forceUpdate()
// },
onActivated(e) {
this.nodeid = e
onActivated(id, zindex) {
this.zindex = zindex
this.nodeid = id
var i
var zindexes = []
for (i = 0; i < Object.keys(this.configPositions).length; i++) {
zindexes.push(this.configPositions[i].z_index)
if (this.configPositions[i].node_id == this.nodeid) {
this.width = this.configPositions[i].width
this.height = this.configPositions[i].height
this.pickupz = this.configPositions[i].z_index
this.zindex = this.configPositions[i].z_index
}
}
var topZ = Math.max(...zindexes)
for (i = 0; i < Object.keys(this.configPositions).length; i++) {
if (topZ > 2147483640) {
this.configPositions[i].z_index = 0
}
if (this.configPositions[i].node_id == this.nodeid) {
this.width = this.configPositions[i].width
this.height = this.configPositions[i].height
this.configPositions[i].z_index = topZ + 1
}
}
},
......@@ -331,13 +347,13 @@ export default {
},
onResizestop(x, y, width, height, zindex) {
var localnodeid = this.nodeid
zindex = this.pickupz
var zindex
var i
for (i = 0; i < Object.keys(this.configPositions).length; i++) {
if (this.configPositions[i].node_id == this.nodeid) {
this.width = this.configPositions[i].width
this.height = this.configPositions[i].height
this.pickupz = this.configPositions[i].z_index
zindex = this.configPositions[i].z_index
}
}
this.width = width
......@@ -357,7 +373,7 @@ export default {
},
onDragstop(x, y, width, height, zindex) {
var localnodeid = this.nodeid
zindex = this.pickupz
var zindex
width = this.width
height = this.height
var i
......@@ -365,7 +381,7 @@ export default {
if (this.configPositions[i].node_id == this.nodeid) {
this.localx = this.configPositions[i].x_pos
this.localy = this.configPositions[i].y_pos
this.pickupz = this.configPositions[i].z_index
zindex = this.configPositions[i].z_index
}
}
this.$store.dispatch('movePos', {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment