From 90ff40fbf018990cf656f6a80fd83e82993f28e2 Mon Sep 17 00:00:00 2001 From: coderaiser Date: Mon, 26 Dec 2016 14:49:33 +0200 Subject: [PATCH] refactor(edit) setMenu --- client/edit.js | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/client/edit.js b/client/edit.js index 86ef4fa4..88a6d892 100644 --- a/client/edit.js +++ b/client/edit.js @@ -228,12 +228,14 @@ var CloudCmd, Util, DOM, CloudFunc, MenuIO, Format; } }; - if (error) { - Dialog.alert(TITLE, error); - } else if (!Menu && MenuIO) { - Menu = new MenuIO(Element, options, menuData); - Menu.show(position.x, position.y); - } + if (error) + return Dialog.alert(TITLE, error); + + if (Menu || !MenuIO) + return; + + Menu = new MenuIO(Element, options, menuData); + Menu.show(position.x, position.y); }); }