Class: Drawer

OM.control. Drawer


new Drawer(baseID, config)

Drawer is a class that creates an empty panel where the user can add
content to it. It allows the user to add more tabs as needed.

Parameters:
Name Type Description
baseID String

AThe id of the div element where the Drawer will be
attached to.

config Object

Contains the following settings:


  • width {Integer}. Width of the Drawer in pixels. Default is 400px

  • height {Integer}. Height of the Drawer in pixels. Default is 600px

  • position {Integer}. by default is located in the left side.

    • OM.control.Drawer.LEFT

    • OM.control.Drawer.RIGHT



Methods


addTab(config)

Create and add tab/content to the Drawer

Parameters:
Name Type Description
config Object

Settings for the new panel.
An OM.control.DrawerPanel is created with the given config.

Returns:
Type
void

attachTab(newPanel)

Attach a tab/content pair to the Drawer

Parameters:
Name Type Description
newPanel OM.control.DrawerPanel

The drawer panel to be added

Returns:
Type
void

hideDrawer()

Display the drawer when the user clicks in the drawer icon.

Returns:
Type
void

isVisible()

Used to check if the drawer is visible or not.

Returns:

true if the drawer is visible, false otherwise.

Type
Boolean

moveTabsToLeft()

Scroll to the left across to the tab bar

Returns:
Type
void

moveTabsToRight()

Scroll to the right across to the tab bar

Returns:
Type
void

setPosition(dir)

Set the position of the drawer in the right or left side of the parent div

Parameters:
Name Type Description
dir Integer

The position where the drawer will be placed.

Returns:
Type
void

showDrawer()

Display the drawer when the user clicks in the drawer icon.


updateScrollButtons()

Scroll to the right across to the tab bar

Returns:
Type
void