new ToolbarModel()
Backbone model for the toolbar.
Extends
- Backbone.Model
Members
activeTab :string
The active toolbar tab. All other tabs should be inactive under normal circumstances. It will remain active across page loads. The active item is stored as an ID selector e.g. '#toolbar-item--1'.
Type:
- string
activeTray :string
Represents whether a tray is open or not. Stored as an ID selector e.g. '#toolbar-item--1-tray'.
Type:
- string
areSubtreesLoaded :bool
Menu subtrees are loaded through an AJAX request only when the Toolbar is set to a vertical orientation.
Type:
- bool
defaults :object
Type:
- object
Properties:
Name | Type | Description |
---|---|---|
activeTab |
||
activeTray |
||
isOriented |
||
isFixed |
||
areSubtreesLoaded |
||
isViewportOverflowConstrained |
||
orientation |
||
locked |
||
isTrayToggleVisible |
||
height |
||
offsets |
height :number
The height of the toolbar.
Type:
- number
isFixed :bool
Indicates whether the toolbar is positioned absolute (false) or fixed (true).
Type:
- bool
isOriented :bool
Indicates whether the toolbar is displayed in an oriented fashion, either horizontal or vertical.
Type:
- bool
isTrayToggleVisible :bool
Indicates whether the tray orientation toggle is visible.
Type:
- bool
isViewportOverflowConstrained :bool
If the viewport overflow becomes constrained, isFixed must be true so that elements in the trays aren't lost off-screen and impossible to get to.
Type:
- bool
locked :bool
A tray is locked if a user toggled it to vertical. Otherwise a tray will switch between vertical and horizontal orientation based on the configured breakpoints. The locked state will be maintained across page loads.
Type:
- bool
offsets :object
The current viewport offsets determined by Drupal.displace
. The
offsets suggest how a module might position is components relative to
the viewport.
Type:
- object
Properties:
Name | Type | Description |
---|---|---|
top |
number | |
right |
number | |
bottom |
number | |
left |
number |
orientation :string
The orientation of the active tray.
Type:
- string
Methods
validate(attributes, options) → {string|undefined}
{@inheritdoc}
Parameters:
Name | Type | Description |
---|---|---|
attributes |
object | Attributes for the toolbar. |
options |
object | Options for the toolbar. |
Returns:
Returns an error message if validation failed.
- Type
- string | undefined