Skip to content

Commit

Permalink
Merge branch 'release-1.3.0' of github.com:fex-team/kityminder into r…
Browse files Browse the repository at this point in the history
…elease-1.3.0
  • Loading branch information
techird committed Oct 9, 2014
2 parents e987794 + dbd4a13 commit f1b00e7
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions src/module/editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,11 @@ KityMinder.registerModule('TextEditModule', function() {

var mousedownNode,mouseupTimer;

var lastMinderNode;
function inputStatusReady(node){
if (node && km.isSingleSelect() && node.isSelected()) {

node.getTextGroup().setStyle('cursor','default');

var color = node.getStyle('text-selection-color');

Expand Down Expand Up @@ -94,11 +96,13 @@ KityMinder.registerModule('TextEditModule', function() {
if(node){

if (this.isSingleSelect() && node.isSelected()) {
lastMinderNode = node;

mousedownNode = node;

var textGroup = node.getTextGroup();

textGroup.setStyle('cursor', 'default');

sel.collapse(true);
sel.setColor(node.getStyle('text-selection-color'));

Expand All @@ -111,13 +115,15 @@ KityMinder.registerModule('TextEditModule', function() {

if(selectionReadyShow){

textGroup.setStyle('cursor', 'text');

sel.setShowStatus();
setTimeout(function() {

sel.collapse(true)
.updatePosition(receiver.getOffsetByIndex())
.setShow();
textGroup.setStyle('cursor','text');

}, 200);
km.setStatus('textedit');

Expand All @@ -132,6 +138,12 @@ KityMinder.registerModule('TextEditModule', function() {
//当点击空白处时,光标需要消失
receiver.clear();


if(lastMinderNode){

lastMinderNode.getTextGroup().setStyle('cursor','default');
}

},
'inputready.keyup':function(){
if(sel.isHide()){
Expand Down Expand Up @@ -184,6 +196,7 @@ KityMinder.registerModule('TextEditModule', function() {
sel.collapse(true)
.updatePosition(receiver.getOffsetByIndex())
.setShow();
node.getTextGroup().setStyle('cursor','text');
}, 200);


Expand Down

0 comments on commit f1b00e7

Please sign in to comment.