Tabs Class
Widget that contains several tabs and their content Options:
- mode: "vertical","horizontal"
- size
- width,height
- autoswitch: allow autoswitch (switch when mouse over)
Constructor
Tabs
()
Item Index
Methods
addTab
-
id
-
options
-
skip_event
Create a new tab, where id is a unique identifier
Parameters:
-
id
Stringcould 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
Boolprevent dispatching events
Returns:
an object containing { id, tab, content }
getCurrentTab
()
Object
Returns the currently selected tab in the form of a tab object
Returns:
the tab in the form of an object with {id,tab,content}
getCurrentTab
()
Object
Returns the last tab pressed before this one. used to know from which tab we come
Returns:
the tab in the form of an object with {id,tab,content}
getNumOfTabs
()
Number
Returns how many tabs there is
Returns:
number of tabs
getTab
-
id
Returns a tab given its id
Parameters:
-
id
Stringtab id
Returns:
the tab in the form of an object with {id,tab,content}
getTabByIndex
-
index
Returns a tab given its index in the tabs list
Parameters:
-
index
Number
Returns:
the tab in the form of an object with {id,tab,content}
getTabContent
-
id
Returns the content HTML element of a tab
Parameters:
-
id
String
Returns:
content
getTabIndex
-
id
Returns the index of a tab (the position in the tabs list)
Parameters:
-
id
String
Returns:
index