Commit e9cd07b2 authored by Akikonata's avatar Akikonata

fixed bug

parent d2a737a2
...@@ -34,7 +34,7 @@ kity.extendClass( Minder, function () { ...@@ -34,7 +34,7 @@ kity.extendClass( Minder, function () {
select: function ( nodes ) { select: function ( nodes ) {
this.removeAllSelectedNodes(); this.removeAllSelectedNodes();
var me = this; var me = this;
utils.each( utils.isArray( nodes ) ? nodes : [ nodes ], function ( i, n ) { Utils.each( Utils.isArray( nodes ) ? nodes : [ nodes ], function ( i, n ) {
me._selectedNodes.push( n ); me._selectedNodes.push( n );
highlightNode( me, n ); highlightNode( me, n );
} ); } );
...@@ -42,15 +42,15 @@ kity.extendClass( Minder, function () { ...@@ -42,15 +42,15 @@ kity.extendClass( Minder, function () {
}, },
addSelect: function ( node ) { addSelect: function ( node ) {
var me = this; var me = this;
me._selectedNodes.push( node ); if ( me._selectedNodes.indexOf( node ) === -1 ) me._selectedNodes.push( node );
highlightNode( me, node ); highlightNode( me, node );
}, },
isNodeSelected: function ( node ) { isNodeSelected: function ( node ) {
return node.getData( 'highlight' ) === true return node.getData( 'highlight' ) === true;
}, },
//当前选区中的节点在给定的节点范围内的保留选中状态,没在给定范围的取消选中,给定范围中的但没在当前选中范围的也做选中效果 //当前选区中的节点在给定的节点范围内的保留选中状态,没在给定范围的取消选中,给定范围中的但没在当前选中范围的也做选中效果
toggleSelect: function ( nodes ) { toggleSelect: function ( nodes ) {
nodes = utils.isArray( nodes ) ? nodes : [ nodes ]; nodes = Utils.isArray( nodes ) ? nodes : [ nodes ];
var selectedNodes = this.getSelectedNodes().slice( 0 ); var selectedNodes = this.getSelectedNodes().slice( 0 );
this.removeAllSelectedNodes(); this.removeAllSelectedNodes();
for ( var i = 0, n; n = selectedNodes[ i ]; ) { for ( var i = 0, n; n = selectedNodes[ i ]; ) {
......
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