Merge branch 'develop' of https://github.com/Connoropolous/metamaps_gen002
This commit is contained in:
commit
10dedaa169
4 changed files with 32 additions and 43 deletions
|
@ -1129,11 +1129,18 @@ Metamaps.JIT = {
|
|||
sY = -1 * sY;
|
||||
eY = -1 * eY
|
||||
|
||||
Metamaps.Synapses.each(function(synapse) {
|
||||
var fromNodeX = synapse.get('edge').nodeFrom.pos.x;
|
||||
var fromNodeY = -1 * synapse.get('edge').nodeFrom.pos.y;
|
||||
var toNodeX = synapse.get('edge').nodeTo.pos.x;
|
||||
var toNodeY = -1 * synapse.get('edge').nodeTo.pos.y;
|
||||
var edgesToToggle = [];
|
||||
Metamaps.Synapses.each(function(synapse) {
|
||||
var e = synapse.get('edge');
|
||||
if (edgesToToggle.indexOf(e) === -1) {
|
||||
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 maxY = fromNodeY;
|
||||
|
@ -1209,21 +1216,18 @@ Metamaps.JIT = {
|
|||
|
||||
//The test synapse was selected!
|
||||
|
||||
// make sure the edge hasn't been hidden from the page
|
||||
var node1id = synapse.get('edge').nodeFrom.id;
|
||||
var node2id = synapse.get('edge').nodeTo.id;
|
||||
var edge = Metamaps.Visualize.mGraph.graph.getAdjacence(node1id, node2id);
|
||||
if(selectTest){
|
||||
if(selectTest){
|
||||
// shiftKey = toggleSelect, otherwise
|
||||
if(e.shiftKey){
|
||||
if(Metamaps.Selected.Edges.indexOf(synapse.get('edge')) != -1 ){
|
||||
Metamaps.Control.deselectEdge(synapse.get('edge'));
|
||||
if(Metamaps.Selected.Edges.indexOf(edge) != -1 ){
|
||||
Metamaps.Control.deselectEdge(edge);
|
||||
}
|
||||
else{
|
||||
if (edge) Metamaps.Control.selectEdge(synapse.get('edge'));
|
||||
Metamaps.Control.selectEdge(edge);
|
||||
}
|
||||
}
|
||||
else{
|
||||
if (edge) Metamaps.Control.selectEdge(synapse.get('edge'));
|
||||
Metamaps.Control.selectEdge(edge);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
|
|
@ -225,7 +225,6 @@
|
|||
|
||||
if (href.attr === "") Metamaps.Router.home();
|
||||
else {
|
||||
console.log(segments);
|
||||
Metamaps.Router[segments[0]](segments[1], segments[2]);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -9,7 +9,7 @@ Metamaps.Views.init = function () {
|
|||
|
||||
template: Hogan.compile( $('#mapperCardTemplate').html() ),
|
||||
|
||||
tagName: "div",
|
||||
tagNamea: "div",
|
||||
|
||||
className: "mapper",
|
||||
|
||||
|
@ -91,8 +91,10 @@ Metamaps.Views.init = function () {
|
|||
}
|
||||
|
||||
Metamaps.Loading.hide();
|
||||
setTimeout(function(){
|
||||
var path = Metamaps.currentSection == "" ? "" : "/explore/" + Metamaps.currentPage;
|
||||
|
||||
clearTimeout(Metamaps.routerTimeoutFunctionIds);
|
||||
Metamaps.routerTimeoutId = setTimeout((function(localCurrentPage){ return function(){
|
||||
var path = (Metamaps.currentSection == "") ? "" : "/explore/" + localCurrentPage;
|
||||
|
||||
// alter url if for mapper profile page
|
||||
if (that.collection && that.collection.mapperId) {
|
||||
|
@ -100,7 +102,7 @@ Metamaps.Views.init = function () {
|
|||
}
|
||||
|
||||
Metamaps.Router.navigate(path);
|
||||
}, 500);
|
||||
}})(Metamaps.currentPage), 500);
|
||||
},
|
||||
handleSuccess: function () {
|
||||
var that = this;
|
||||
|
@ -133,4 +135,4 @@ Metamaps.Views.init = function () {
|
|||
Metamaps.Views.exploreMaps = new mapsWrapper();
|
||||
};
|
||||
|
||||
})();
|
||||
})();
|
||||
|
|
|
@ -2818,20 +2818,8 @@ Metamaps.Control = {
|
|||
}
|
||||
|
||||
Metamaps.Control.deselectNode(node);
|
||||
|
||||
node.setData('alpha', 0, 'end');
|
||||
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.Visualize.mGraph.graph.removeNode(nodeid);
|
||||
Metamaps.Visualize.mGraph.plot();
|
||||
Metamaps.Filter.checkMetacodes();
|
||||
Metamaps.Filter.checkMappers();
|
||||
},
|
||||
|
@ -2996,17 +2984,13 @@ Metamaps.Control = {
|
|||
hideEdge: function (edge) {
|
||||
var from = edge.nodeFrom.id;
|
||||
var to = edge.nodeTo.id;
|
||||
edge.setData('alpha', 0, 'end');
|
||||
Metamaps.Control.deselectEdge(edge);
|
||||
Metamaps.Visualize.mGraph.fx.animate({
|
||||
modes: ['edge-property:alpha'],
|
||||
duration: 500
|
||||
});
|
||||
setTimeout(function () {
|
||||
if (Metamaps.Visualize.mGraph.graph.getAdjacence(from, to)) {
|
||||
Metamaps.Visualize.mGraph.graph.removeAdjacence(from, to);
|
||||
}, 500);
|
||||
Metamaps.Filter.checkSynapses();
|
||||
Metamaps.Filter.checkMappers();
|
||||
Metamaps.Visualize.mGraph.plot();
|
||||
Metamaps.Filter.checkSynapses();
|
||||
Metamaps.Filter.checkMappers();
|
||||
}
|
||||
},
|
||||
updateSelectedPermissions: function (permission) {
|
||||
|
||||
|
|
Loading…
Reference in a new issue