From 79c171655bda6dbe4ff1ebf2b260e3671b0acaf6 Mon Sep 17 00:00:00 2001 From: coderaiser Date: Fri, 24 Feb 2017 10:21:13 +0200 Subject: [PATCH] fix(menu) isPath: menu does not open when the root is empty (#108) --- client/menu.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/client/menu.js b/client/menu.js index 957af2b2..4d4f3e09 100644 --- a/client/menu.js +++ b/client/menu.js @@ -192,7 +192,11 @@ function MenuProto(position) { } function isPath(x, y) { - const panel = Info.panel; + const {panel} = Info; + const isEmptyRoot = !panel; + + if (isEmptyRoot) + return false; const el = document.elementFromPoint(x, y); const elements = panel.querySelectorAll('[data-name="js-path"] *');