Extends
Constructor
new OO.ui.TabPanelLayout(name, [config])
#
TabPanelLayouts are used within index layouts
to create tab panels that
users can select and display from the index's optional tab
navigation. TabPanels are usually not instantiated directly, rather extended to include the
required content and functionality.
Each tab panel must have a unique symbolic name, which is passed to the constructor. In addition,
the tab panel's tab item is customized (with a label) using the #setupTabItem method. See
IndexLayout
for an example.
Parameters:
Name | Type | Attributes | Description | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
name |
string | Unique symbolic name of tab panel |
|||||||||||||
config |
Object |
optional |
Configuration options Properties:
|
- Source:
TabPanelLayouts are used within index layouts
to create tab panels that
users can select and display from the index's optional tab
navigation.
Methods
focus()
#
Focus the panel layout
The default implementation just focuses the first focusable element in the panel
- Inherited from:
- Source:
Focus the panel layout
The default implementation just focuses the first focusable element in the panel
getClosestScrollableElementContainer() → {HTMLElement}
#
Get closest scrollable container.
- Inherited from:
- Source:
Returns:
Closest scrollable container
- Type
- HTMLElement
getData() → {any}
#
Get element data.
- Inherited from:
- Source:
Returns:
Element data
- Type
- any
getElementDocument() → {HTMLDocument}
#
getElementGroup() → {OO.ui.mixin.GroupElement|null
}
#
null
}
#
Get group element is in.
- Inherited from:
- Source:
Returns:
Group element, null if none
- Type
-
OO.ui.mixin.GroupElement
|
null
getElementId() → {string}
#
Ensure that the element has an 'id' attribute, setting it to an unique value if it's missing, and return its value.
- Inherited from:
- Source:
Returns:
- Type
- string
Ensure that the element has an 'id' attribute, setting it to an unique value if it's missing, and return its value.
getElementWindow() → {Window}
#
getName() → {string}
#
Get the symbolic name of the tab panel.
- Source:
Returns:
Symbolic name of tab panel
- Type
- string
getTabItem() → {OO.ui.TabOptionWidget|null
}
#
null
}
#
Get tab item.
The tab item allows users to access the tab panel from the index's tab navigation. The tab item itself can be customized (with a label, level, etc.) using the #setupTabItem method.
- Source:
Returns:
Tab option widget
- Type
-
OO.ui.TabOptionWidget
|
null
getTabItemConfig() → {Object}
#
getTagName() → {string}
#
Get the HTML tag name.
Override this method to base the result on instance information.
- Inherited from:
- Source:
Returns:
HTML tag name
- Type
- string
isActive() → {boolean}
#
Check if tab panel is active.
Tab panels become active when they are shown in a index layout
that is
configured to display only one tab panel at a time. Additional CSS is applied to the tab panel's
tab item to reflect the active state.
- Source:
Returns:
Tab panel is active
- Type
- boolean
isElementAttached() → {boolean}
#
Check if the element is attached to the DOM
- Inherited from:
- Source:
Returns:
The element is attached to the DOM
- Type
- boolean
isVisible() → {boolean}
#
Check if element is visible.
- Inherited from:
- Source:
Returns:
element is visible
- Type
- boolean
resetScroll() → {OO.ui.Layout}chainable
#
restorePreInfuseState(state)protected
#
Restore the pre-infusion dynamic state for this widget.
This method is called after #$element has been inserted into DOM. The parameter is the return value of #gatherPreInfuseState.
Parameters:
Name | Type | Description |
---|---|---|
state |
Object |
- Inherited from:
- Source:
scrollElementIntoView([config]) → {jQuery.Promise}
#
Scroll element into view.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
config |
Object |
optional |
Configuration options |
- Inherited from:
- Source:
Returns:
Promise which resolves when the scroll is complete
- Type
- jQuery.Promise
setActive([active])
#
Set the tab panel to its 'active' state.
Tab panels become active when they are shown in a index layout that is configured to display only one tab panel at a time. Additional CSS is applied to the tab item to reflect the tab panel's active state. Outside of the index context, setting the active state on a tab panel does nothing.
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
active |
boolean |
optional |
false | Tab panel is active |
- Source:
Fires:
setData(data) → {OO.ui.Element}chainable
#
Set element data.
Parameters:
Name | Type | Description |
---|---|---|
data |
any | Element data |
- Inherited from:
- Source:
Returns:
The element, for chaining
- Type
- OO.ui.Element
setElementGroup(group) → {OO.ui.Element}chainable
#
Set group element is in.
Parameters:
Name | Type | Description |
---|---|---|
group |
OO.ui.mixin.GroupElement
|
null
|
Group element, null if none |
- Inherited from:
- Source:
Returns:
The element, for chaining
- Type
- OO.ui.Element
setElementId(id) → {OO.ui.Element}chainable
#
Set the element has an 'id' attribute.
Parameters:
Name | Type | Description |
---|---|---|
id |
string |
- Inherited from:
- Source:
Returns:
The element, for chaining
- Type
- OO.ui.Element
setTabItem(tabItem) → {OO.ui.TabPanelLayout}chainable
#
Set or unset the tab item.
Specify a tab option
to set it,
or null
to clear the tab item. To customize the tab item itself (e.g., to set a label or tab
level), use #setupTabItem instead of this method.
Parameters:
Name | Type | Description |
---|---|---|
tabItem |
OO.ui.TabOptionWidget
|
null
|
Tab option widget, null to clear |
- Source:
Returns:
The layout, for chaining
- Type
- OO.ui.TabPanelLayout
setupTabItem(tabItem) → {OO.ui.TabPanelLayout}chainable
#
Set up the tab item.
Use this method to customize the tab item (e.g., to add a label or tab level). To set or unset
the tab item itself (with a tab option
or null
), use
the #setTabItem method instead.
Parameters:
Name | Type | Description |
---|---|---|
tabItem |
OO.ui.TabOptionWidget | Tab option widget to set up |
- Source:
Returns:
The layout, for chaining
- Type
- OO.ui.TabPanelLayout
supports(methods) → {boolean}
#
Check if element supports one or more methods.
Parameters:
Name | Type | Description |
---|---|---|
methods |
string | Array.<string> | Method or list of methods to check |
- Inherited from:
- Source:
Returns:
All methods are supported
- Type
- boolean
toggle([show]) → {OO.ui.Element}chainable
#
Toggle visibility of an element.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
show |
boolean |
optional |
Make element visible, omit to toggle visibility |
- Inherited from:
- Source:
Returns:
The element, for chaining
- Type
- OO.ui.Element
Fires:
updateThemeClasses()
#
Update the theme-provided classes.
This is called in element mixins and widget classes any time state changes. Updating is debounced, minimizing overhead of changing multiple attributes and guaranteeing that theme updates do not occur within an element's constructor
- Inherited from:
- Source:
Events
active(active)
#
An 'active' event is emitted when the tab panel becomes active. Tab panels become active when they are shown in a index layout that is configured to display only one tab panel at a time.
Parameters:
Name | Type | Description |
---|---|---|
active |
boolean | Tab panel is active |
- Source: