Commit 65a97743 authored by campaign's avatar campaign

by zhanyi

parent b88195ef
...@@ -30,4 +30,5 @@ kity.extendClass( Minder, { ...@@ -30,4 +30,5 @@ kity.extendClass( Minder, {
km.renderNode( nodes ); km.renderNode( nodes );
} }
} }
} ); } );
\ No newline at end of file
...@@ -219,5 +219,8 @@ var MinderNode = KityMinder.MinderNode = kity.createClass( "MinderNode", { ...@@ -219,5 +219,8 @@ var MinderNode = KityMinder.MinderNode = kity.createClass( "MinderNode", {
}, },
getTextShape:function(){ getTextShape:function(){
return this.getRenderContainer().getShapesByType('text')[0] return this.getRenderContainer().getShapesByType('text')[0]
},
isSelected : function(){
return this.getData( 'highlight' ) === true
} }
} ); } );
\ No newline at end of file
...@@ -11,12 +11,12 @@ KityMinder.registerModule( "TextEditModule", function () { ...@@ -11,12 +11,12 @@ KityMinder.registerModule( "TextEditModule", function () {
}, },
"events": { "events": {
'beforemousedown':function(e){ 'beforemousedown':function(e){
if(this.isSingleSelect()){ var node = e.getTargetNode();
if(node){
var node = this.getSelectedNode();
var textShape = node.getTextShape(); var textShape = node.getTextShape();
textShape.setStyle('cursor','default');
// node.getRenderContainer().setStyle('cursor','text'); if(node.isSelected()){
node.getTextShape().setStyle('cursor','text');
receiver.setTextEditStatus(true) receiver.setTextEditStatus(true)
.setCursor(cursor) .setCursor(cursor)
.setKityMinder(this) .setKityMinder(this)
...@@ -29,7 +29,9 @@ KityMinder.registerModule( "TextEditModule", function () { ...@@ -29,7 +29,9 @@ KityMinder.registerModule( "TextEditModule", function () {
.updateCursor() .updateCursor()
.setRange(range); .setRange(range);
} }
}else{
receiver.clear();
}
} }
} }
}; };
......
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