mirror of
https://github.com/NuSkooler/enigma-bbs.git
synced 2025-06-06 12:47:13 +02:00
* Added ability to pass a "menu result" from a menu when calling prev()/prevMenu()
* Ability to fully quit newscan with X key using new menu result functionality
This commit is contained in:
parent
48aa0fa606
commit
0a3a62edf3
5 changed files with 35 additions and 9 deletions
|
@ -73,6 +73,8 @@ module.exports = class MenuStack {
|
|||
}
|
||||
|
||||
prev(cb) {
|
||||
const menuResult = this.top().instance.getMenuResult();
|
||||
|
||||
// :TODO: leave() should really take a cb...
|
||||
this.pop().instance.leave(); // leave & remove current
|
||||
|
||||
|
@ -80,8 +82,9 @@ module.exports = class MenuStack {
|
|||
|
||||
if(previousModuleInfo) {
|
||||
const opts = {
|
||||
extraArgs : previousModuleInfo.extraArgs,
|
||||
savedState : previousModuleInfo.savedState
|
||||
extraArgs : previousModuleInfo.extraArgs,
|
||||
savedState : previousModuleInfo.savedState,
|
||||
lastMenuResult : menuResult,
|
||||
};
|
||||
|
||||
return this.goto(previousModuleInfo.name, opts, cb);
|
||||
|
@ -112,7 +115,8 @@ module.exports = class MenuStack {
|
|||
};
|
||||
|
||||
if(_.isObject(options)) {
|
||||
loadOpts.extraArgs = options.extraArgs;
|
||||
loadOpts.extraArgs = options.extraArgs;
|
||||
loadOpts.lastMenuResult = options.lastMenuResult;
|
||||
}
|
||||
|
||||
loadMenu(loadOpts, (err, modInst) => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue