Extends
Constructor
new OO.ui.PageLayout(name, [config])
#
PageLayouts are used within booklet layouts to create pages that
users can select and display from the booklet's optional
outline navigation. Pages are usually not instantiated
directly, rather extended to include the required content and functionality.
Each page must have a unique symbolic name, which is passed to the constructor. In addition, the
page's outline item is customized (with a label, outline level, etc.) using
the #setupOutlineItem method. See BookletLayout for an example.
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
name |
string | Unique symbolic name of page |
|
config |
Object |
optional |
Configuration options |
- Source:
PageLayouts are used within booklet layouts to create pages that
users can select and display from the booklet's optional
outline 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.
Returns:
Closest scrollable container
- Type
- HTMLElement
- Inherited from:
- Source:
getData() → {any}
#
Get element data.
Returns:
Element data
- Type
- any
- Inherited from:
- Source:
getElementDocument() → {HTMLDocument}
#
getElementGroup() → {OO.ui.mixin.GroupElement|null}
#
null}
#
Get group element is in.
Returns:
Group element, null if none
- Type
-
OO.ui.mixin.GroupElement
|
null
- Inherited from:
- Source:
getElementId() → {string}
#
Ensure that the element has an 'id' attribute, setting it to an unique value if it's missing, and return its value.
Returns:
- Type
- string
- Inherited from:
- Source:
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 page.
Returns:
Symbolic name of page
- Type
- string
- Source:
getOutlineItem() → {OO.ui.OutlineOptionWidget|null}
#
null}
#
Get outline item.
The outline item allows users to access the page from the booklet's outline navigation. The outline item itself can be customized (with a label, level, etc.) using the #setupOutlineItem method.
Returns:
Outline option widget
- Type
-
OO.ui.OutlineOptionWidget
|
null
- Source:
getTagName() → {string}
#
Get the HTML tag name.
Override this method to base the result on instance information.
Returns:
HTML tag name
- Type
- string
- Inherited from:
- Source:
isActive() → {boolean}
#
Check if page is active.
Pages become active when they are shown in a booklet layout that is
configured to display only one page at a time. Additional CSS is applied to the page's outline
item to reflect the active state.
Returns:
Page is active
- Type
- boolean
- Source:
isElementAttached() → {boolean}
#
Check if the element is attached to the DOM
Returns:
The element is attached to the DOM
- Type
- boolean
- Inherited from:
- Source:
isVisible() → {boolean}
#
Check if element is visible.
Returns:
element is visible
- Type
- boolean
- Inherited from:
- Source:
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 |
Returns:
Promise which resolves when the scroll is complete
- Type
- jQuery.Promise
- Inherited from:
- Source:
setActive([active])
#
Set the page to its 'active' state.
Pages become active when they are shown in a booklet layout that is configured to display only one page at a time. Additional CSS is applied to the outline item to reflect the page's active state. Outside of the booklet context, setting the active state on a page does nothing.
Parameters:
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
active |
boolean |
optional |
false | Page is active |
Fires:
- Source:
setData(data) → {OO.ui.Element}chainable
#
Set element data.
Parameters:
| Name | Type | Description |
|---|---|---|
data |
any | Element data |
Returns:
The element, for chaining
- Type
- OO.ui.Element
- Inherited from:
- Source:
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 |
Returns:
The element, for chaining
- Type
- OO.ui.Element
- Inherited from:
- Source:
setElementId(id) → {OO.ui.Element}chainable
#
Set the element has an 'id' attribute.
Parameters:
| Name | Type | Description |
|---|---|---|
id |
string |
Returns:
The element, for chaining
- Type
- OO.ui.Element
- Inherited from:
- Source:
setOutlineItem(outlineItem) → {OO.ui.PageLayout}chainable
#
Set or unset the outline item.
Specify an outline option to set it,
or null to clear the outline item. To customize the outline item itself (e.g., to set a label
or outline level), use #setupOutlineItem instead of this method.
Parameters:
| Name | Type | Description |
|---|---|---|
outlineItem |
OO.ui.OutlineOptionWidget
|
null
|
Outline option widget, null to clear |
Returns:
The layout, for chaining
- Type
- OO.ui.PageLayout
- Source:
setupOutlineItem()protected
#
Set up the outline item.
Override this method to customize the outline item (e.g., to add a label or outline level). To
set or unset the outline item itself (with an outline option or
null), use the #setOutlineItem method instead.
- Source:
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 |
Returns:
All methods are supported
- Type
- boolean
- Inherited from:
- Source:
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 |
Returns:
The element, for chaining
- Type
- OO.ui.Element
Fires:
- Inherited from:
- Source:
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 page becomes active. Pages become active when they are shown in a booklet layout that is configured to display only one page at a time.
Parameters:
| Name | Type | Description |
|---|---|---|
active |
boolean | Page is active |
- Source: