Commit 7af2f5bd authored by campaign's avatar campaign

by zhanyi

parent 1a36d361
...@@ -48,7 +48,7 @@ kity.extendClass( Minder, function () { ...@@ -48,7 +48,7 @@ kity.extendClass( Minder, function () {
}, },
isNodeSelected: function ( node ) { isNodeSelected: function ( node ) {
return node.getData( 'highlight' ) === true; return node.getTmpData( 'highlight' ) === true;
}, },
//当前选区中的节点在给定的节点范围内的保留选中状态,没在给定范围的取消选中,给定范围中的但没在当前选中范围的也做选中效果 //当前选区中的节点在给定的节点范围内的保留选中状态,没在给定范围的取消选中,给定范围中的但没在当前选中范围的也做选中效果
toggleSelect: function ( nodes ) { toggleSelect: function ( nodes ) {
......
...@@ -231,6 +231,7 @@ var MinderNode = KityMinder.MinderNode = kity.createClass( "MinderNode", { ...@@ -231,6 +231,7 @@ var MinderNode = KityMinder.MinderNode = kity.createClass( "MinderNode", {
var _tmp = new KM.MinderNode( isClonedNode.getText() ); var _tmp = new KM.MinderNode( isClonedNode.getText() );
_tmp.data = Utils.clonePlainObject( isClonedNode.getData() ); _tmp.data = Utils.clonePlainObject( isClonedNode.getData() );
_tmp.tmpData = Utils.clonePlainObject( isClonedNode.getTmpData() )
_tmp.parent = parent; _tmp.parent = parent;
if ( parent ) { if ( parent ) {
parent.children.push( _tmp ); parent.children.push( _tmp );
...@@ -252,7 +253,9 @@ var MinderNode = KityMinder.MinderNode = kity.createClass( "MinderNode", { ...@@ -252,7 +253,9 @@ var MinderNode = KityMinder.MinderNode = kity.createClass( "MinderNode", {
if ( utils.compareObject( node.getData(), this.getData() ) === false ) { if ( utils.compareObject( node.getData(), this.getData() ) === false ) {
return false; return false;
} }
if ( utils.compareObject( node.getTmpData(), this.getTmpData() ) === false ) {
return false;
}
for ( var i = 0, ci; for ( var i = 0, ci;
( ci = this.children[ i ] );i++ ) { ( ci = this.children[ i ] );i++ ) {
if ( ci.equals( node.children[i] ) === false ) { if ( ci.equals( node.children[i] ) === false ) {
...@@ -288,6 +291,9 @@ var MinderNode = KityMinder.MinderNode = kity.createClass( "MinderNode", { ...@@ -288,6 +291,9 @@ var MinderNode = KityMinder.MinderNode = kity.createClass( "MinderNode", {
} }
}, },
getTmpData:function(a){ getTmpData:function(a){
if ( a === undefined ) {
return this.tmpData;
}
return this.tmpData[a] return this.tmpData[a]
} }
} ); } );
\ No newline at end of file
...@@ -5,7 +5,6 @@ KityMinder.registerModule( "HistoryModule", function () { ...@@ -5,7 +5,6 @@ KityMinder.registerModule( "HistoryModule", function () {
var Scene = kity.createClass( 'Scene', { var Scene = kity.createClass( 'Scene', {
constructor: function ( root ) { constructor: function ( root ) {
this.data = root.clone(); this.data = root.clone();
}, },
getData: function () { getData: function () {
return this.data; return this.data;
...@@ -147,6 +146,7 @@ KityMinder.registerModule( "HistoryModule", function () { ...@@ -147,6 +146,7 @@ KityMinder.registerModule( "HistoryModule", function () {
}, },
"renderNode":function(e){ "renderNode":function(e){
var node = e.node; var node = e.node;
if(node.isHighlight()){ if(node.isHighlight()){
km.select(node); km.select(node);
} }
......
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