From 8cb0a95695d1ebc6905c7c6e3e4328825ae2113e Mon Sep 17 00:00:00 2001 From: coderaiser Date: Fri, 22 May 2015 06:15:39 -0400 Subject: [PATCH] fix(menu) show menu on path --- lib/client/menu.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/lib/client/menu.js b/lib/client/menu.js index 51a99b6d..db1434bb 100644 --- a/lib/client/menu.js +++ b/lib/client/menu.js @@ -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; }