This is the gist from the start of the thread, modified in the way I described (the non-hacky way).
https://www.espruino.com/ide/?gist=e346a3df9ab3ab26e5f4238c15e8f7f0
The changes required to menu code are:
// First menu var mainmenu = { "" : { "title" : "Main Menu" }, "< Back" : function() { print("Back") }, "Submenu" : function() { E.showMenu(submenu); }, }; var submenu = { "" : { "title" : "SubMenu" }, "< Back" : function() { E.showMenu(mainmenu); }, "One" : undefined, // do nothing };
becomes:
var submenu = { "" : { "title" : "SubMenu" }, "< Back" : function() { E.showMenu(mainmenu); }, "One" : undefined, // do nothing }; // First menu var mainmenu = { "" : { "title" : "Main Menu" }, "< Back" : function() { print("Back") }, "Submenu" : { submenu: submenu }, }
@myownself started
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
This is the gist from the start of the thread, modified in the way I described (the non-hacky way).
https://www.espruino.com/ide/?gist=e346a3df9ab3ab26e5f4238c15e8f7f0
The changes required to menu code are:
becomes: