Alright, I'm almost done, check the attached video.
My only remaining question is: how can I go back to the original menu when I validate my input or click the back button? Currently I pass the original menu in a goBackTo object
var hours = 10;
var minutes = 32;
var menu = {
'Time': function () {showDoubleIntPicker("Title",{
goBackTo: menu,
value_1: hours,
step_1: 1,
min_1: 0,
max_1: 23,
wrap_1: true,
value_2: minutes,
step_2: 1,
min_2: 0,
max_2: 59,
wrap_2: true,
format: function (v_1, v_2) {},
onchange: function (v_1, v_2) {hours = v_1; minutes = v_2;}
});}
};
and then call E.showMenu(goBackTo); when I need to go back.
But I imagine there are more elegant ways to do it?
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.
Alright, I'm almost done, check the attached video.
My only remaining question is: how can I go back to the original menu when I validate my input or click the back button? Currently I pass the original menu in a
goBackTo
objectand then call
E.showMenu(goBackTo);
when I need to go back.But I imagine there are more elegant ways to do it?
1 Attachment