mirror of
https://bitbucket.org/wisemapping/wisemapping-open-source.git
synced 2024-11-05 07:03:24 +01:00
- Fix do/redo removal of multiple elements
This commit is contained in:
parent
3a0c79a2a8
commit
a5acdc7bb7
@ -49,8 +49,9 @@ mindplot.commands.DeleteCommand = new Class({
|
||||
commandContext.deleteRelationship(relationship);
|
||||
}
|
||||
|
||||
// Delete the node itself ...
|
||||
this._deletedTopicModels.push(model);
|
||||
// Store information for undo ...
|
||||
var clonedModel = model.clone();
|
||||
this._deletedTopicModels.push(clonedModel);
|
||||
var outTopic = topic.getOutgoingConnectedTopic();
|
||||
var outTopicId = null;
|
||||
if (outTopic != null) {
|
||||
@ -84,7 +85,7 @@ mindplot.commands.DeleteCommand = new Class({
|
||||
var parentTopic = parent[index];
|
||||
if (parentTopic != null) {
|
||||
commandContext.connect(topic, parentTopic);
|
||||
topic.setOnFocus();
|
||||
topic.setOnFocus(true);
|
||||
}
|
||||
|
||||
}.bind(this)
|
||||
|
@ -234,7 +234,7 @@ mindplot.model.INodeModel = new Class({
|
||||
deleteNode : function() {
|
||||
var mindmap = this.getMindmap();
|
||||
|
||||
console.log("Before:" + mindmap.inspect());
|
||||
// console.log("Before:" + mindmap.inspect());
|
||||
var parent = this.getParent();
|
||||
if ($defined(parent)) {
|
||||
parent.removeChild(this);
|
||||
@ -243,7 +243,7 @@ mindplot.model.INodeModel = new Class({
|
||||
mindmap.removeBranch(this);
|
||||
}
|
||||
// It's an isolated node. It must be a hole branch ...
|
||||
console.log("After:" + mindmap.inspect());
|
||||
// console.log("After:" + mindmap.inspect());
|
||||
},
|
||||
|
||||
getPropertiesKeys : function() {
|
||||
|
@ -86,7 +86,7 @@ mindplot.model.NodeModel = new Class({
|
||||
|
||||
clone : function() {
|
||||
var result = new mindplot.model.NodeModel(this.getType(), this._mindmap);
|
||||
result._children = this._children.each(function(node) {
|
||||
result._children = this._children.map(function(node) {
|
||||
var cnode = node.clone();
|
||||
cnode._parent = result;
|
||||
return cnode;
|
||||
@ -201,10 +201,5 @@ mindplot.model.NodeModel = new Class({
|
||||
}
|
||||
}
|
||||
return result;
|
||||
},
|
||||
|
||||
|
||||
inspect : function() {
|
||||
return '(type:' + this.getType() + ' , id: ' + this.getId() + ')';
|
||||
}
|
||||
});
|
Loading…
Reference in New Issue
Block a user