API Docs for:
Show:

Tabs Class

Defined in: ../src/tabs.js:5

Widget that contains several tabs and their content Options:

  • mode: "vertical","horizontal"
  • size
  • width,height
  • autoswitch: allow autoswitch (switch when mouse over)

Constructor

Tabs

()

Defined in ../src/tabs.js:5

Methods

addTab

(
  • id
  • options
  • skip_event
)
Object

Defined in ../src/tabs.js:213

Create a new tab, where id is a unique identifier

Parameters:

  • id String

    could be null then a random id is generated

  • options Object

    { title: tab text, callback: called when selected, callback_leave: callback when leaving, callback_context: on right click on tab callback_canopen: used to block if this tab can be opened or not (if it returns true then yes) content: HTML content, closable: if it can be closed (callback is onclose), tab_width: size of the tab, tab_className: classes for the tab element, id: content id, size: full means all, mode: "vertical" or "horizontal", button: if it is a button tab, not a selectable tab }

  • skip_event Bool

    prevent dispatching events

Returns:

Object:

an object containing { id, tab, content }

getCurrentTab

() Object

Defined in ../src/tabs.js:110

Returns the currently selected tab in the form of a tab object

Returns:

Object:

the tab in the form of an object with {id,tab,content}

getCurrentTab

() Object

Defined in ../src/tabs.js:127

Returns the last tab pressed before this one. used to know from which tab we come

Returns:

Object:

the tab in the form of an object with {id,tab,content}

getNumOfTabs

() Number

Defined in ../src/tabs.js:169

Returns how many tabs there is

Returns:

Number:

number of tabs

getTab

(
  • id
)
Object

Defined in ../src/tabs.js:147

Returns a tab given its id

Parameters:

  • id String

    tab id

Returns:

Object:

the tab in the form of an object with {id,tab,content}

getTabByIndex

(
  • index
)
Object

Defined in ../src/tabs.js:158

Returns a tab given its index in the tabs list

Parameters:

  • index Number

Returns:

Object:

the tab in the form of an object with {id,tab,content}

getTabContent

(
  • id
)
HTMLEntity

Defined in ../src/tabs.js:182

Returns the content HTML element of a tab

Parameters:

  • id String

Returns:

HTMLEntity:

content

getTabIndex

(
  • id
)
Number

Defined in ../src/tabs.js:195

Returns the index of a tab (the position in the tabs list)

Parameters:

  • id String

Returns:

Number:

index