change delete behaviour to be smarter
This commit is contained in:
parent
7814ce153c
commit
471fb03bb2
2 changed files with 11 additions and 4 deletions
|
@ -113,9 +113,14 @@ Metamaps.Control = {
|
|||
removeSelectedNodes: function () { // refers to removing topics permanently from a map
|
||||
if (Metamaps.Active.Topic) {
|
||||
// hideNode will handle synapses as well
|
||||
_.each(Metamaps.Selected.Nodes, function(node) {
|
||||
Metamaps.Control.hideNode(node.id)
|
||||
Metamaps.Topics.remove(node.id)
|
||||
var nodeids = _.map(Metamaps.Selected.Nodes, function(node) {
|
||||
return node.id
|
||||
})
|
||||
_.each(nodeids, function(nodeid) {
|
||||
if (Metamaps.Active.Topic.id !== nodeid) {
|
||||
Metamaps.Topics.remove(nodeid)
|
||||
Metamaps.Control.hideNode(nodeid)
|
||||
}
|
||||
})
|
||||
return
|
||||
}
|
||||
|
|
|
@ -105,7 +105,9 @@ Metamaps.Topic = {
|
|||
Metamaps.Visualize.mGraph.onClick(nodeid, {
|
||||
hideLabels: false,
|
||||
duration: 1000,
|
||||
onComplete: callback
|
||||
onComplete: function () {
|
||||
if (callback) callback()
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
|
|
Loading…
Add table
Reference in a new issue