Commit 408f2ed0 authored by campaign's avatar campaign

by zhanyi

parent ca15319e
......@@ -14,15 +14,11 @@ kity.extendClass( Minder, function () {
this._selectedNodes = [];
},
getSelectedNodes: function () {
//如果没有选中节点,默认是root节点
if ( this._selectedNodes.length === 0 ) {
this._selectedNodes.push( this.getRoot() );
}
//不能克隆返回,会对当前选区操作,从而影响querycommand
return this._selectedNodes;
},
getSelectedNode: function () {
return this.getSelectedNodes()[ 0 ];
return this.getSelectedNodes()[ 0 ] || null;
},
removeAllSelectedNodes: function () {
var me = this;
......
......@@ -12,7 +12,7 @@ KityMinder.registerModule( "TextEditModule", function () {
"events": {
'beforemousedown':function(e){
cursor.setHide();
var node = e.getTargetNode();
var node = this.getSelectedNode();
if(node){
var textShape = node.getTextShape();
textShape.setStyle('cursor','default');
......
......@@ -71,10 +71,7 @@ KityMinder.registerModule( "MouseModule", function () {
};
} )();
return {
"init": function () {
// kity.extendClass( kity.Paper, Draggable );
// this._paper.drag();
},
"events": {
'mousedown touchstart': function ( e ) {
if ( e.originEvent.touches && e.originEvent.touches.length != 1 ) return;
......@@ -97,8 +94,7 @@ KityMinder.registerModule( "MouseModule", function () {
var node = e.getTargetNode();
if ( !node ) return;
this._touchTimeout = setTimeout( function () {
me.clearSelect();
me.execCommand( 'kbCreateAndEdit', 'child', node );
}, 200 );
}
},
......
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