diff --git a/index.html b/index.html
index 5e993bb..7531f9f 100644
--- a/index.html
+++ b/index.html
@@ -2102,10 +2102,12 @@ AFRAME.registerComponent('update-links-on-pinchended', {
let rootEl = document.querySelector("#graphroot")
let el = this.el
this.el.addEventListener('released', function (event) {
+ let found_links = 0
Object.keys( rootEl.components ) // get all links
.filter( i => i.indexOf(el.id) > -1 ) // keeps links related to the moved node
.map( i => { // for each link
- let newpos = el.getAttribute("position")
+ found_links++
+ let newpos = AFRAME.utils.coordinates.stringify( el.getAttribute("position") )
let [src,tgt] = i.replace("line__","").split("__to__");
srcpos = AFRAME.utils.coordinates.stringify( rootEl.getAttribute(i).start )
tgtpos = AFRAME.utils.coordinates.stringify( rootEl.getAttribute(i).end )
@@ -2114,7 +2116,6 @@ AFRAME.registerComponent('update-links-on-pinchended', {
} else {
rootEl.setAttribute(i, { start: srcpos, end: newpos })
}
- // somehow works once...
})
})
}