From b627977f9cb4cd9c3237a5a7e01af1a4cb9b2c3f Mon Sep 17 00:00:00 2001 From: Andrew Pamment Date: Tue, 12 Jul 2016 20:52:17 +1000 Subject: [PATCH] Fixed Next/prev conf/areas --- core/system_menu_method.js | 26 ++++++++++++++++++++++---- 1 file changed, 22 insertions(+), 4 deletions(-) diff --git a/core/system_menu_method.js b/core/system_menu_method.js index 254f676c..e76d4bad 100644 --- a/core/system_menu_method.js +++ b/core/system_menu_method.js @@ -89,6 +89,9 @@ function prevConf(callingMenu) { } return; }); + let prevMenu = callingMenu.client.menuStack.pop(); + prevMenu.instance.leave(); + callingMenu.client.menuStack.goto(prevMenu.name); return; } else { prev_tag = confs[i].confTag; @@ -102,13 +105,16 @@ function nextConf(callingMenu) { if (confs.length > 1) { for (var i=1;i { if (err) { //... } return; }); + let prevMenu = callingMenu.client.menuStack.pop(); + prevMenu.instance.leave(); + callingMenu.client.menuStack.goto(prevMenu.name); return; } else { prev_tag = confs[i].confTag; @@ -118,6 +124,9 @@ function nextConf(callingMenu) { if (err) { //... } + let prevMenu = callingMenu.client.menuStack.pop(); + prevMenu.instance.leave(); + callingMenu.client.menuStack.goto(prevMenu.name); return; }); } @@ -134,9 +143,12 @@ function prevArea(callingMenu) { } return; }); + let prevMenu = callingMenu.client.menuStack.pop(); + prevMenu.instance.leave(); + callingMenu.client.menuStack.goto(prevMenu.name); return; } else { - prev_tag = areas[i].confTag; + prev_tag = areas[i].areaTag; } } } @@ -147,22 +159,28 @@ function nextArea(callingMenu) { if (areas.length > 1) { for (var i=1;i { if (err) { //... } return; }); + let prevMenu = callingMenu.client.menuStack.pop(); + prevMenu.instance.leave(); + callingMenu.client.menuStack.goto(prevMenu.name); return; } else { - prev_tag = areas[i].confTag; + prev_tag = areas[i].areaTag; } } messageArea.changeMessageArea(callingMenu.client, areas[0].areaTag, err => { if (err) { //... } + let prevMenu = callingMenu.client.menuStack.pop(); + prevMenu.instance.leave(); + callingMenu.client.menuStack.goto(prevMenu.name); return; }); }