added user feedback, and moved the edge actually hiding into the if statement where it should be
This commit is contained in:
parent
a048c87356
commit
670dd5d874
1 changed files with 8 additions and 4 deletions
|
@ -2762,6 +2762,8 @@ Metamaps.Control = {
|
||||||
topicid: topicid
|
topicid: topicid
|
||||||
}]);
|
}]);
|
||||||
Metamaps.Control.hideNode(nodeid);
|
Metamaps.Control.hideNode(nodeid);
|
||||||
|
} else {
|
||||||
|
Metamaps.GlobalUI.notifyUser('Only topics you created can be deleted');
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
removeSelectedNodes: function () { // refers to removing topics permanently from a map
|
removeSelectedNodes: function () { // refers to removing topics permanently from a map
|
||||||
|
@ -2914,10 +2916,6 @@ Metamaps.Control = {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (edge.getData("synapses").length - 1 === 0) {
|
|
||||||
Metamaps.Control.hideEdge(edge);
|
|
||||||
}
|
|
||||||
|
|
||||||
var index = edge.getData("displayIndex") ? edge.getData("displayIndex") : 0;
|
var index = edge.getData("displayIndex") ? edge.getData("displayIndex") : 0;
|
||||||
|
|
||||||
var synapse = edge.getData("synapses")[index];
|
var synapse = edge.getData("synapses")[index];
|
||||||
|
@ -2925,6 +2923,10 @@ Metamaps.Control = {
|
||||||
|
|
||||||
var permToDelete = Metamaps.Active.Mapper.id === synapse.get('user_id');
|
var permToDelete = Metamaps.Active.Mapper.id === synapse.get('user_id');
|
||||||
if (permToDelete) {
|
if (permToDelete) {
|
||||||
|
if (edge.getData("synapses").length - 1 === 0) {
|
||||||
|
Metamaps.Control.hideEdge(edge);
|
||||||
|
}
|
||||||
|
|
||||||
var synapseid = synapse.id;
|
var synapseid = synapse.id;
|
||||||
synapse.destroy();
|
synapse.destroy();
|
||||||
|
|
||||||
|
@ -2938,6 +2940,8 @@ Metamaps.Control = {
|
||||||
$(document).trigger(Metamaps.JIT.events.deleteSynapse, [{
|
$(document).trigger(Metamaps.JIT.events.deleteSynapse, [{
|
||||||
synapseid: synapseid
|
synapseid: synapseid
|
||||||
}]);
|
}]);
|
||||||
|
} else {
|
||||||
|
Metamaps.GlobalUI.notifyUser('Only synapses you created can be deleted');
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
removeSelectedEdges: function () {
|
removeSelectedEdges: function () {
|
||||||
|
|
Loading…
Reference in a new issue