Commit dbd4a13c authored by campaign's avatar campaign

修复光标变换为 text状态显示的问题

parent ccac8146
...@@ -18,9 +18,11 @@ KityMinder.registerModule('TextEditModule', function() { ...@@ -18,9 +18,11 @@ KityMinder.registerModule('TextEditModule', function() {
var mousedownNode,mouseupTimer; var mousedownNode,mouseupTimer;
var lastMinderNode;
function inputStatusReady(node){ function inputStatusReady(node){
if (node && km.isSingleSelect() && node.isSelected()) { if (node && km.isSingleSelect() && node.isSelected()) {
node.getTextGroup().setStyle('cursor','default');
var color = node.getStyle('text-selection-color'); var color = node.getStyle('text-selection-color');
...@@ -93,11 +95,13 @@ KityMinder.registerModule('TextEditModule', function() { ...@@ -93,11 +95,13 @@ KityMinder.registerModule('TextEditModule', function() {
if(node){ if(node){
if (this.isSingleSelect() && node.isSelected()) { if (this.isSingleSelect() && node.isSelected()) {
lastMinderNode = node;
mousedownNode = node; mousedownNode = node;
var textGroup = node.getTextGroup(); var textGroup = node.getTextGroup();
textGroup.setStyle('cursor', 'default');
sel.collapse(true); sel.collapse(true);
sel.setColor(node.getStyle('text-selection-color')); sel.setColor(node.getStyle('text-selection-color'));
...@@ -110,13 +114,15 @@ KityMinder.registerModule('TextEditModule', function() { ...@@ -110,13 +114,15 @@ KityMinder.registerModule('TextEditModule', function() {
if(selectionReadyShow){ if(selectionReadyShow){
textGroup.setStyle('cursor', 'text');
sel.setShowStatus(); sel.setShowStatus();
setTimeout(function() { setTimeout(function() {
sel.collapse(true) sel.collapse(true)
.updatePosition(receiver.getOffsetByIndex()) .updatePosition(receiver.getOffsetByIndex())
.setShow(); .setShow();
textGroup.setStyle('cursor','text');
}, 200); }, 200);
km.setStatus('textedit'); km.setStatus('textedit');
...@@ -131,6 +137,12 @@ KityMinder.registerModule('TextEditModule', function() { ...@@ -131,6 +137,12 @@ KityMinder.registerModule('TextEditModule', function() {
//当点击空白处时,光标需要消失 //当点击空白处时,光标需要消失
receiver.clear(); receiver.clear();
if(lastMinderNode){
lastMinderNode.getTextGroup().setStyle('cursor','default');
}
}, },
'inputready.keyup':function(){ 'inputready.keyup':function(){
if(sel.isHide()){ if(sel.isHide()){
...@@ -183,6 +195,7 @@ KityMinder.registerModule('TextEditModule', function() { ...@@ -183,6 +195,7 @@ KityMinder.registerModule('TextEditModule', function() {
sel.collapse(true) sel.collapse(true)
.updatePosition(receiver.getOffsetByIndex()) .updatePosition(receiver.getOffsetByIndex())
.setShow(); .setShow();
node.getTextGroup().setStyle('cursor','text');
}, 200); }, 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