From 118cb97487e82b1bfbca7e83f66fb019fa3ec786 Mon Sep 17 00:00:00 2001 From: Bryan Ashby Date: Tue, 17 Jul 2018 20:00:47 -0600 Subject: [PATCH] MenuModule.reload(), updated @systemMethod:reloadMenu(), and notes --- core/menu_module.js | 6 ++++++ core/system_menu_method.js | 6 ++---- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/core/menu_module.js b/core/menu_module.js index d284aa64..67fabb7e 100644 --- a/core/menu_module.js +++ b/core/menu_module.js @@ -187,6 +187,12 @@ exports.MenuModule = class MenuModule extends PluginModule { return this.client.menuStack.goto(name, options, cb); } + reload(cb) { + const prevMenu = this.client.menuStack.pop(); + prevMenu.instance.leave(); + return this.client.menuStack.goto(prevMenu.name, cb); + } + addViewController(name, vc) { assert(!this.viewControllers[name], `ViewController by the name of "${name}" already exists!`); diff --git a/core/system_menu_method.js b/core/system_menu_method.js index 9c9cd6d3..9218e34a 100644 --- a/core/system_menu_method.js +++ b/core/system_menu_method.js @@ -87,11 +87,9 @@ function nextMenu(callingMenu, formData, extraArgs, cb) { }); } -// :TODO: prev/nextConf, prev/nextArea should use a NYI MenuModule.redraw() or such -- avoid pop/goto() hack! +// :TODO: need redrawMenu() and MenuModule.redraw() function reloadMenu(menu, cb) { - const prevMenu = menu.client.menuStack.pop(); - prevMenu.instance.leave(); - menu.client.menuStack.goto(prevMenu.name, cb); + return menu.reload(cb); } function prevConf(callingMenu, formData, extraArgs, cb) {