Commit 14521fb9 authored by Akikonata's avatar Akikonata

Merge branch 'dev' of https://github.com/kitygraph/kityminder into dev

parents 94bb191d 1601ae9e
...@@ -34,7 +34,9 @@ var MinderNode = KityMinder.MinderNode = kity.createClass( "MinderNode", { ...@@ -34,7 +34,9 @@ var MinderNode = KityMinder.MinderNode = kity.createClass( "MinderNode", {
this._createGroup( 'contrc' ); this._createGroup( 'contrc' );
}, },
_createTextShape: function () { _createTextShape: function () {
this.getContRc().appendShape( new kity.Text( this.getData( 'text' ) || '' ) ); var textShape = new kity.Text( this.getData( 'text' ) || '' );
textShape.setAttr('_nodeTextShape',true);
this.getContRc().appendShape( textShape );
}, },
_createIconShape: function () { _createIconShape: function () {
var g = new kity.Group(); var g = new kity.Group();
...@@ -301,7 +303,14 @@ var MinderNode = KityMinder.MinderNode = kity.createClass( "MinderNode", { ...@@ -301,7 +303,14 @@ var MinderNode = KityMinder.MinderNode = kity.createClass( "MinderNode", {
}, },
getTextShape: function () { getTextShape: function () {
return this.getContRc().getShapesByType( 'text' )[ 0 ]; var textShape;
utils.each(this.getContRc().getShapesByType( 'text' ),function(i,t){
if(t.getAttr('_nodeTextShape')){
textShape = t;
return false;
}
});
return textShape;
}, },
isSelected: function () { isSelected: function () {
return this.getTmpData( 'highlight' ) === true; return this.getTmpData( 'highlight' ) === true;
......
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