Commit 217e0408 authored by techird's avatar techird

fix drop test bug

parent 726ee5bb
...@@ -300,7 +300,7 @@ var TreeDragger = kity.createClass('TreeDragger', { ...@@ -300,7 +300,7 @@ var TreeDragger = kity.createClass('TreeDragger', {
function area(box) { function area(box) {
return box.width * box.height; return box.width * box.height;
} }
return intersectBox && area(intersectBox) > 0.5 * Math.min(area(sourceBox), area(targetBox)); return intersectBox && area(intersectBox) > 0.5 * Math.min(area(sourceBox), area(targetBox), 1e4);
}); });
this._renderDropHint(this._dropSucceedTarget); this._renderDropHint(this._dropSucceedTarget);
return !!this._dropSucceedTarget; return !!this._dropSucceedTarget;
...@@ -321,7 +321,7 @@ var TreeDragger = kity.createClass('TreeDragger', { ...@@ -321,7 +321,7 @@ var TreeDragger = kity.createClass('TreeDragger', {
_renderOrderHint: function(hint) { _renderOrderHint: function(hint) {
this._orderHinter.render(hint); this._orderHinter.render(hint);
}, },
preventDragMove:function(){ preventDragMove: function() {
this._startPosition = null; this._startPosition = null;
} }
}); });
...@@ -349,8 +349,8 @@ KityMinder.registerModule('DragTree', function() { ...@@ -349,8 +349,8 @@ KityMinder.registerModule('DragTree', function() {
e.stopPropagation(); e.stopPropagation();
this.fire('contentchange'); this.fire('contentchange');
}, },
'statuschange':function(e){ 'statuschange': function(e) {
if(e.lastStatus == 'textedit' && e.currentStatus == 'normal'){ if (e.lastStatus == 'textedit' && e.currentStatus == 'normal') {
dragger.preventDragMove(); dragger.preventDragMove();
} }
} }
......
...@@ -183,8 +183,8 @@ KityMinder.registerModule("KeyboardModule", function() { ...@@ -183,8 +183,8 @@ KityMinder.registerModule("KeyboardModule", function() {
} }
}, },
'normal.keyup':function(e){ 'normal.keyup': function(e) {
if(browser.ipad){ if (browser.ipad) {
var keys = KityMinder.keymap; var keys = KityMinder.keymap;
var node = e.getTargetNode(); var node = e.getTargetNode();
var lang = this.getLang(); var lang = this.getLang();
......
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