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,25 +11,27 @@ KityMinder.registerModule( "TextEditModule", function () { ...@@ -11,25 +11,27 @@ 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()){
receiver.setTextEditStatus(true) node.getTextShape().setStyle('cursor','text');
.setCursor(cursor) receiver.setTextEditStatus(true)
.setKityMinder(this) .setCursor(cursor)
.setMinderNode(node) .setKityMinder(this)
.setTextShape(textShape) .setMinderNode(node)
.setBaseOffset() .setTextShape(textShape)
.setContainerStyle() .setBaseOffset()
.setCursorHeight() .setContainerStyle()
.setCurrentIndex(e.getPosition()) .setCursorHeight()
.updateCursor() .setCurrentIndex(e.getPosition())
.setRange(range); .updateCursor()
.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