Merge branch 'develop' of github.com:Connoropolous/metamaps_gen002
This commit is contained in:
commit
8b146fccab
2 changed files with 25 additions and 37 deletions
|
@ -1129,11 +1129,18 @@ Metamaps.JIT = {
|
||||||
sY = -1 * sY;
|
sY = -1 * sY;
|
||||||
eY = -1 * eY
|
eY = -1 * eY
|
||||||
|
|
||||||
Metamaps.Synapses.each(function(synapse) {
|
var edgesToToggle = [];
|
||||||
var fromNodeX = synapse.get('edge').nodeFrom.pos.x;
|
Metamaps.Synapses.each(function(synapse) {
|
||||||
var fromNodeY = -1 * synapse.get('edge').nodeFrom.pos.y;
|
var e = synapse.get('edge');
|
||||||
var toNodeX = synapse.get('edge').nodeTo.pos.x;
|
if (edgesToToggle.indexOf(e) === -1) {
|
||||||
var toNodeY = -1 * synapse.get('edge').nodeTo.pos.y;
|
edgesToToggle.push(e);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
edgesToToggle.forEach(function(edge) {
|
||||||
|
var fromNodeX = edge.nodeFrom.pos.x;
|
||||||
|
var fromNodeY = -1 * edge.nodeFrom.pos.y;
|
||||||
|
var toNodeX = edge.nodeTo.pos.x;
|
||||||
|
var toNodeY = -1 * edge.nodeTo.pos.y;
|
||||||
|
|
||||||
var maxX = fromNodeX;
|
var maxX = fromNodeX;
|
||||||
var maxY = fromNodeY;
|
var maxY = fromNodeY;
|
||||||
|
@ -1209,21 +1216,18 @@ Metamaps.JIT = {
|
||||||
|
|
||||||
//The test synapse was selected!
|
//The test synapse was selected!
|
||||||
|
|
||||||
// make sure the edge hasn't been hidden from the page
|
if(selectTest){
|
||||||
var node1id = synapse.get('edge').nodeFrom.id;
|
// shiftKey = toggleSelect, otherwise
|
||||||
var node2id = synapse.get('edge').nodeTo.id;
|
|
||||||
var edge = Metamaps.Visualize.mGraph.graph.getAdjacence(node1id, node2id);
|
|
||||||
if(selectTest){
|
|
||||||
if(e.shiftKey){
|
if(e.shiftKey){
|
||||||
if(Metamaps.Selected.Edges.indexOf(synapse.get('edge')) != -1 ){
|
if(Metamaps.Selected.Edges.indexOf(edge) != -1 ){
|
||||||
Metamaps.Control.deselectEdge(synapse.get('edge'));
|
Metamaps.Control.deselectEdge(edge);
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
if (edge) Metamaps.Control.selectEdge(synapse.get('edge'));
|
Metamaps.Control.selectEdge(edge);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
if (edge) Metamaps.Control.selectEdge(synapse.get('edge'));
|
Metamaps.Control.selectEdge(edge);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
@ -2818,20 +2818,8 @@ Metamaps.Control = {
|
||||||
}
|
}
|
||||||
|
|
||||||
Metamaps.Control.deselectNode(node);
|
Metamaps.Control.deselectNode(node);
|
||||||
|
Metamaps.Visualize.mGraph.graph.removeNode(nodeid);
|
||||||
node.setData('alpha', 0, 'end');
|
Metamaps.Visualize.mGraph.plot();
|
||||||
node.eachAdjacency(function (adj) {
|
|
||||||
adj.setData('alpha', 0, 'end');
|
|
||||||
});
|
|
||||||
Metamaps.Visualize.mGraph.fx.animate({
|
|
||||||
modes: ['node-property:alpha',
|
|
||||||
'edge-property:alpha'
|
|
||||||
],
|
|
||||||
duration: 500
|
|
||||||
});
|
|
||||||
setTimeout(function () {
|
|
||||||
Metamaps.Visualize.mGraph.graph.removeNode(nodeid);
|
|
||||||
}, 500);
|
|
||||||
Metamaps.Filter.checkMetacodes();
|
Metamaps.Filter.checkMetacodes();
|
||||||
Metamaps.Filter.checkMappers();
|
Metamaps.Filter.checkMappers();
|
||||||
},
|
},
|
||||||
|
@ -2996,17 +2984,13 @@ Metamaps.Control = {
|
||||||
hideEdge: function (edge) {
|
hideEdge: function (edge) {
|
||||||
var from = edge.nodeFrom.id;
|
var from = edge.nodeFrom.id;
|
||||||
var to = edge.nodeTo.id;
|
var to = edge.nodeTo.id;
|
||||||
edge.setData('alpha', 0, 'end');
|
|
||||||
Metamaps.Control.deselectEdge(edge);
|
Metamaps.Control.deselectEdge(edge);
|
||||||
Metamaps.Visualize.mGraph.fx.animate({
|
if (Metamaps.Visualize.mGraph.graph.getAdjacence(from, to)) {
|
||||||
modes: ['edge-property:alpha'],
|
|
||||||
duration: 500
|
|
||||||
});
|
|
||||||
setTimeout(function () {
|
|
||||||
Metamaps.Visualize.mGraph.graph.removeAdjacence(from, to);
|
Metamaps.Visualize.mGraph.graph.removeAdjacence(from, to);
|
||||||
}, 500);
|
Metamaps.Visualize.mGraph.plot();
|
||||||
Metamaps.Filter.checkSynapses();
|
Metamaps.Filter.checkSynapses();
|
||||||
Metamaps.Filter.checkMappers();
|
Metamaps.Filter.checkMappers();
|
||||||
|
}
|
||||||
},
|
},
|
||||||
updateSelectedPermissions: function (permission) {
|
updateSelectedPermissions: function (permission) {
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue