Menu

Drawer Plugin

The drawer plugin allows you to add left and right fly-out views.

Sample Usage

const drawer = await DrawerPlugin.init()
const webView = await WebViewPlugin.init()

const leftMenu = drawer.initLeftMenu(webView)
leftMenu.open()

Methods

DrawerPlugin.init() #

Creates and returns an instance of the drawer plugin that is used to make subsequent method calls.


setContentView(plugin) #

Sets the view for the main content of the drawer to the plugin provided.


initLeftMenu(plugin) #

Sets a plugin's view as the drawer's left menu and returns an object with open(), close(), toggle(), lockClosed() and unlock() methods that control it.

Sample usage:

const drawer = await DrawerPlugin.init()
const webView = await WebViewPlugin.init()
const leftMenu = drawer.initLeftMenu(webView)
leftMenu.open()

initRightMenu(plugin) #

Sets a plugin's view as the drawer's right menu and returns an object with open(), close(), toggle(), lockClosed() and unlock() methods that control it.

const drawer = await DrawerPlugin.init()
const webView = await WebViewPlugin.init()
webView.navigate('http://www.mobify.com')
const rightMenu = drawer.initRightMenu(webView)
rightMenu.open()

setLeftMenu(plugin) #

Sets a plugin's view as the drawer's left menu.


setRightMenu(plugin) #

Sets a plugin's view as the drawer's right menu.


showLeftMenu() #

Slides the drawer's left menu open.


showRightMenu() #

Slides the drawer's right menu open.


hideLeftMenu() #

Slides the drawer's left menu closed.


hideRightMenu() #

Slides the drawer's right menu closed.


toggleLeftMenu() #

Toggles the open state of the drawer's left menu.


toggleRightMenu() #

Toggles the open state of the drawer's right menu.


lockLeftMenuClosed() #

Locks the left drawer menu. Locking the menu will also close it.


lockRightMenuClosed() #

Locks the right drawer menu. Locking the menu will also close it.


unlockLeftMenu() #

Unlock the left drawer menu.


unlockRightMenu() #

Unlock the right drawer menu.