Commit fbb1b81e authored by campaign's avatar campaign

修复孤立node节点容错

parent c0f3895f
......@@ -40,6 +40,7 @@ kity.extendClass(Minder, {
handelNodeCreate: function(node) {
var rc = this._rc;
node.traverse(function(current) {
current.attached = true;
rc.addShape(current.getRenderContainer());
});
rc.addShape(node.getRenderContainer());
......@@ -48,6 +49,7 @@ kity.extendClass(Minder, {
handelNodeRemove: function(node) {
var rc = this._rc;
node.traverse(function(current) {
current.attached = false;
rc.removeShape(current.getRenderContainer());
});
},
......
......@@ -185,6 +185,7 @@ var MinderNode = KityMinder.MinderNode = kity.createClass('MinderNode', {
if (index >= 0) {
removed = this.children.splice(index, 1)[0];
removed.parent = null;
removed.root = removed;
}
},
......
......@@ -27,6 +27,7 @@ var Renderer = KityMinder.Renderer = kity.createClass('Renderer', {
kity.extendClass(Minder, {
_createRendererForNode: function(node) {
var registered = this._renderers;
var renderers = [];
......@@ -48,6 +49,7 @@ kity.extendClass(Minder, {
},
renderNode: function(node) {
var rendererClasses = this._renderers;
var g = KityMinder.Geometry;
var i, latestBox, renderer;
......@@ -107,6 +109,7 @@ kity.extendClass(Minder, {
kity.extendClass(MinderNode, {
render: function() {
if (!this.attached) return;
this.getMinder().renderNode(this);
return this;
},
......
......@@ -123,7 +123,9 @@ KityMinder.registerModule("HistoryModule", function() {
traverseNode(km.getRoot(), target);
km.layout();
km.select(selectedNodes,true);
selectedNodes = [];
},
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment