Commit 781e8706 authored by campaign's avatar campaign

by zhanyi

parent 7d95683e
// 选区管理 // 选区管理
kity.extendClass( Minder, function () { kity.extendClass( Minder, function () {
function highlightNode( km, node ) { function highlightNode( km, node ) {
node.setAttr( "highlight", true ); node.setTmpData( "highlight", true );
km.highlightNode( node ); km.highlightNode( node );
} }
function unhighlightNode( km, node ) { function unhighlightNode( km, node ) {
node.setAttr( "highlight", false ); node.setTmpData( "highlight", false );
km.highlightNode( node ); km.highlightNode( node );
} }
return { return {
......
...@@ -3,6 +3,7 @@ var MinderNode = KityMinder.MinderNode = kity.createClass( "MinderNode", { ...@@ -3,6 +3,7 @@ var MinderNode = KityMinder.MinderNode = kity.createClass( "MinderNode", {
this.parent = null; this.parent = null;
this.children = []; this.children = [];
this.data = {}; this.data = {};
this.tmpData = {};
if ( Utils.isString( options ) ) { if ( Utils.isString( options ) ) {
this.setData( 'text', options ); this.setData( 'text', options );
} else { } else {
...@@ -271,22 +272,22 @@ var MinderNode = KityMinder.MinderNode = kity.createClass( "MinderNode", { ...@@ -271,22 +272,22 @@ var MinderNode = KityMinder.MinderNode = kity.createClass( "MinderNode", {
this.children = []; this.children = [];
}, },
isHighlight : function(){ isHighlight : function(){
return this.getAttr('highlight') return this.getTmpData('highlight')
}, },
setAttr : function(a,v){ setTmpData : function(a,v){
var me = this; var me = this;
if(utils.isObject(a)){ if(utils.isObject(a)){
utils.each(a,function(val,key){ utils.each(a,function(val,key){
me.setAttr(key,val) me.setTmpData(key,val)
}) })
} }
if(v === undefined || v === null || v === ''){ if(v === undefined || v === null || v === ''){
this.node.removeAttribute(a); delete this.tmpData[a];
}else { }else {
this.node.setAttribute(a,v); this.tmpData[a] = v;
} }
}, },
getAttr:function(a){ getTmpData:function(a){
return this.node.getAttribute(a) return this.tmpData[a]
} }
} ); } );
\ No newline at end of file
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