Commit 3640269d authored by Adam Procter's avatar Adam Procter

updates

parent d61d759e
Pipeline #224 failed with stages
in 1 minute and 21 seconds
...@@ -74,25 +74,22 @@ export default { ...@@ -74,25 +74,22 @@ export default {
nodes.on("startyourpositions", event => { nodes.on("startyourpositions", event => {
console.log("hit"); console.log("hit");
//console.log(nodes) // if (element.id == SVG.get(element.id)){
// data2.forEach(element => {
// // console.log(element.id);
// // console.log(element.xpos);
// // console.log(element.ypos);
// // now use SVG.get for the dom and look for matching g id and move that to location
// if (element.id == SVG.get(element.id)){
// SVG.get(element.id).animate().move(element.xpos,element.ypos) // SVG.get(element.id).animate().move(element.xpos,element.ypos)
// } // }
// });
data2.forEach(
element => {if (element.id == SVG.get(element.id))
element.animate().move(element.xpos,element.ypos)
}
); data2.forEach(function(element) {
if (element.id == SVG.get(element.id)){
//console.log(element.id);
//console.log(element.xpos);
//console.log(element.ypos);
// console.log(SVG.get(element.id))
var bob = SVG.get(element.id).rect(10,10);
//console.log(bob);
bob.cx(element.xpos).cy(element.ypos-370)
}
});
}); });
...@@ -120,10 +117,11 @@ export default { ...@@ -120,10 +117,11 @@ export default {
knowledgeObj.ellipse(20, 50).attr({ knowledgeObj.ellipse(20, 50).attr({
fill: colours[Math.floor(Math.random() * colours.length)] fill: colours[Math.floor(Math.random() * colours.length)]
}); });
} }
objectsProcessed++; objectsProcessed++;
if (objectsProcessed === data.length) { if (objectsProcessed === data.length) {
nodes.fire("startyourpositions"); nodes.fire("startyourpositions");
console.log("fire..."); console.log("fire...");
} }
...@@ -161,8 +159,8 @@ export default { ...@@ -161,8 +159,8 @@ export default {
this.ypos = event.clientY; this.ypos = event.clientY;
this.$store.dispatch("updateKnowledgePosition", this); this.$store.dispatch("updateKnowledgePosition", this);
// the node which was clicked // the node which was clicked
//console.log(event.target); console.log(event.clientX);
//console.log(event.clientX); console.log(event.clientY);
// the svgjs object // the svgjs object
//console.log(SVG.adopt(event.target)) //console.log(SVG.adopt(event.target))
}); });
......
...@@ -158,17 +158,22 @@ export default new Vuex.Store({ ...@@ -158,17 +158,22 @@ export default new Vuex.Store({
commit("SHOW_KNOWLEDGE_OBJECTS", element); commit("SHOW_KNOWLEDGE_OBJECTS", element);
}); });
}); });
positions_db
.allDocs({ },
include_docs: true,
attachments: true getKnowledgePositions({ commit }) {
}) positions_db
.then(result => { .allDocs({
Array.from(result.rows.values()).forEach(element => { include_docs: true,
commit("GET_KNOWLEDGE_POSITIONS", element); attachments: true
}); })
}); .then(result => {
}, Array.from(result.rows.values()).forEach(element => {
commit("GET_KNOWLEDGE_POSITIONS", element);
});
});
},
addKnowledgeObject({ commit }, payload) { addKnowledgeObject({ commit }, payload) {
commit("ADD_KNOWLEDGE_OBJECT", payload); commit("ADD_KNOWLEDGE_OBJECT", payload);
......
...@@ -31,6 +31,7 @@ export default { ...@@ -31,6 +31,7 @@ export default {
// FIXME what should the store do here // FIXME what should the store do here
// this.$store.state.count // this.$store.state.count
this.$store.dispatch("showKnowledgeObjects"); this.$store.dispatch("showKnowledgeObjects");
this.$store.dispatch("getKnowledgePositions");
//this.$store.getters.allObjects //this.$store.getters.allObjects
//return this.$store.getters.allObjects //return this.$store.getters.allObjects
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment