Commit 781e8706 authored by campaign's avatar campaign

by zhanyi

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