Commit 2f33dd30 authored by techird's avatar techird

fix event conflic

parent 890bdcdc
......@@ -27,7 +27,7 @@ KM.registerUI( 'contextmenu', function () {
}
});
me.$container.append($menu);
me.on('contextmenu', function (e) {
me.on('aftercontextmenu', function (e) {
e.preventDefault();
if (me.getStatus() == 'hand') return;
......@@ -65,7 +65,7 @@ KM.registerUI( 'contextmenu', function () {
}
});
me.on('click',function(){
me.on('afterclick',function(){
$menu.kmui().hide();
});
me.on('beforemousedown',function(e){
......
......@@ -335,6 +335,7 @@ KityMinder.registerModule('DragTree', function() {
events: {
'normal.mousedown inputready.mousedown': function(e) {
// 单选中根节点也不触发拖拽
if (e.originEvent.button) return;
if (e.getTargetNode() && e.getTargetNode() != this.getRoot()) {
dragger.dragStart(e.getPosition(this.getRenderContainer()));
}
......
......@@ -54,7 +54,6 @@ KityMinder.registerModule('TextEditModule', function() {
'normal.beforemousedown textedit.beforemousedown inputready.beforemousedown': function(e) {
//右键直接退出
if (e.isRightMB()) {
e.stopPropagationImmediately();
return;
}
......
......@@ -28,7 +28,8 @@ var ViewDragger = kity.createClass("ViewDragger", {
lastPosition = null,
currentPosition = null;
this._minder.on('normal.beforemousedown readonly.mousedown readonly.touchstart', function (e) {
this._minder.on('normal.mousedown readonly.mousedown readonly.touchstart', function (e) {
console.log(e);
e.originEvent.preventDefault(); // 阻止中键拉动
// 点击未选中的根节点临时开启
if (e.getTargetNode() == this.getRoot() || e.originEvent.button == 2) {
......
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