mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-07-20 18:18:56 +00:00
fix(menu) show menu on path
This commit is contained in:
parent
16cd7f0bf6
commit
8cb0a95695
1 changed files with 12 additions and 0 deletions
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue