File tree Expand file tree Collapse file tree 2 files changed +8
-1
lines changed Expand file tree Collapse file tree 2 files changed +8
-1
lines changed Original file line number Diff line number Diff line change 3
3
exports . list = function ( g , items ) {
4
4
var options = items [ "" ] ;
5
5
var menuItems = Object . keys ( items ) ;
6
- if ( options ) menuItems . splice ( menuItems . indexOf ( "" ) , 1 ) ;
6
+ if ( options ) {
7
+ menuItems . splice ( menuItems . indexOf ( "" ) , 1 ) ;
8
+ if ( options . back ) { // handle 'options.back'
9
+ items [ "< Back" ] = options . back ;
10
+ menuItems . unshift ( "< Back" ) ;
11
+ }
12
+ }
7
13
if ( ! ( options instanceof Object ) ) options = { } ;
8
14
if ( options . selected === undefined )
9
15
options . selected = 0 ;
Original file line number Diff line number Diff line change @@ -80,6 +80,7 @@ Each object is as follows:
80
80
var menuinfo = {
81
81
"" : {
82
82
"title": "...", // optional, the menu's title
83
+ "back" : function() { } // optional - adds a menu item to go 'back' which calls this function
83
84
"selected": 0, // optional, first selected menu item's index
84
85
"fontHeight": 0, // optional, height of the font being used (default is 6)
85
86
"y": 0, // optional, y offset of menu
You can’t perform that action at this time.
0 commit comments