Commit ccac8146 authored by techird's avatar techird

fix drag issue

parent 09e6a67a
......@@ -152,7 +152,7 @@ kity.extendClass(Minder, {
callbacks[i].call(this, e);
if (this.getStatus() != lastStatus || e.shouldStopPropagationImmediately()) {
if (e.shouldStopPropagationImmediately()) {
break;
}
}
......
......@@ -18,6 +18,8 @@ KityMinder.registerUI('contextmenu', function(minder) {
.addClass('km-context-menu fui-popup-menu')
.appendTo('#content-wrapper');
var downPosition;
$menu.delegate('li', 'mousedown', function(e, info) {
var item = $(e.target).closest('li').data('menu');
if (item.command) {
......@@ -31,15 +33,22 @@ KityMinder.registerUI('contextmenu', function(minder) {
$('#content-wrapper').on('mousedown', function(e) {
$menu.hide();
if (e.button == 2) {
downPosition = [e.pageX, e.pageY].join(',');
} else {
downPosition = null;
}
});
minder.on('mouseup', function(e) {
//e.preventDefault();
if (minder.getStatus() == 'hand' || !e.isRightMB()) return;
if (!e.isRightMB()) return;
e = e.originEvent;
if (downPosition != [e.pageX, e.pageY].join(',')) return;
$menu.empty();
var ctxmenu = minder.getContextMenu();
......
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