fix(menu) show menu on path

This commit is contained in:
coderaiser 2015-05-22 06:15:39 -04:00
parent 16cd7f0bf6
commit 8cb0a95695

View file

@ -160,6 +160,15 @@ var CloudCmd, Util, DOM, CloudFunc, MenuIO;
});
}
function isPath(x, y) {
var panel = Info.panel,
el = document.elementFromPoint(x, y),
elements = panel.querySelectorAll('[data-name="js-path"] *'),
is = ~[].indexOf.call(elements, el);
return is;
}
function beforeShow(callback, params) {
var name = params.name,
notShow = DOM.getCurrentByPosition({
@ -176,6 +185,9 @@ var CloudCmd, Util, DOM, CloudFunc, MenuIO;
Util.exec(callback);
if (!notShow)
notShow = isPath(params.x, params.y);
return notShow;
}