From ebc09c5be2d5a13b0c9e53828984c4fdac3ed87c Mon Sep 17 00:00:00 2001 From: coderaiser Date: Thu, 19 Oct 2017 13:56:47 +0300 Subject: [PATCH] fix(menu) when click on ".." show full menu --- client/modules/menu.js | 27 +++++++++++++++++++++++---- 1 file changed, 23 insertions(+), 4 deletions(-) diff --git a/client/modules/menu.js b/client/modules/menu.js index b65eccb7..a51af6f4 100644 --- a/client/modules/menu.js +++ b/client/modules/menu.js @@ -68,21 +68,40 @@ function MenuProto(Position) { return { x: position.x, y: position.y, - } + }; if (Position) return { x: Position.x, y: Position.y, - } + }; if (position) return { x: position.x, y: position.y, - } + }; return getCurrentPosition(); - }; + } + + function getMenuNameByEl(el) { + if (!el) + return 'context'; + + const name = DOM.getCurrentName(el); + + if (name === '..') + return 'context'; + + return 'contextFile'; + } + + function getMenuByName(name) { + if (name === 'context') + return MenuContext; + + return MenuContextFile; + } function getMenuNameByEl(el) { if (!el)