menu

A very minimalistic library to manage Apple TV menu bars.
Author:
Source:

Members

(static) created

Whether the menu was already created.
Source:

Methods

(static) create(cfg) → {Document}

Generates a menu from the configuration obejct.
Source:
Parameters:
Name Type Description
cfg Object Menu related configurations
Returns:
Type:
Document
The created menu document
Example
ATV.Menu.create({
    attributes: {},
    items: [{
        id: 'search',
        name: 'Search',
        page: SearchPage
    }, {
        id: 'homepage',
        name: 'Home',
        page: HomePage,
        attributes: {
            autoHighlight: true // auto highlight on navigate
        }
    }, {
        id: 'movies',
        name: 'Movies',
        page: MoviesPage
    }, {
        id: 'tvshows',
        name: 'TV Shows',
        page: TVShowsPage
    }]
});

(static) get() → {Document}

Returns instance of the menu document (auto create if not already created)
Source:
Returns:
Type:
Document
Instance of the created menu document.

(static) getErrorMessage() → {String}

Get the menu error message if provided in the config
Source:
Returns:
Type:
String
Error message

(static) getLoadingMessage() → {String}

Get the menu loading message if provided in the config
Source:
Returns:
Type:
String
Loading message

(static) setDocument(doc, menuItemid)

Associate a document to the menuitem (using the menuitem's unique id).
Source:
Parameters:
Name Type Description
doc Document The document to associate with the menuitem
menuItemid String The id of the menu item as per the configuration

(static) setOptions(cfg)

Sets the default menu options
Source:
Parameters:
Name Type Description
cfg Object The configuration object

(static) setSelectedItem(menuItemid)

Set the given menuitem as active (using the menuitem's unique id).
Source:
Parameters:
Name Type Description
menuItemid String The id of the menu item as per the configuration