Class: ToolbarModel

Drupal.toolbar.ToolbarModel()

new ToolbarModel()

Backbone model for the toolbar.

Source:

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
Source:

activeTray :string

Represents whether a tray is open or not. Stored as an ID selector e.g. '#toolbar-item--1-tray'.

Type:
  • string
Source:

areSubtreesLoaded :bool

Menu subtrees are loaded through an AJAX request only when the Toolbar is set to a vertical orientation.

Type:
  • bool
Source:

defaults :object

Type:
  • object
Properties:
Name Type Description
activeTab
activeTray
isOriented
isFixed
areSubtreesLoaded
isViewportOverflowConstrained
orientation
locked
isTrayToggleVisible
height
offsets
Source:

height :number

The height of the toolbar.

Type:
  • number
Source:

isFixed :bool

Indicates whether the toolbar is positioned absolute (false) or fixed (true).

Type:
  • bool
Source:

isOriented :bool

Indicates whether the toolbar is displayed in an oriented fashion, either horizontal or vertical.

Type:
  • bool
Source:

isTrayToggleVisible :bool

Indicates whether the tray orientation toggle is visible.

Type:
  • bool
Source:

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
Source:

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
Source:

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
Source:

orientation :string

The orientation of the active tray.

Type:
  • string
Source:

Methods

validate(attributes, options) → {string|undefined}

{@inheritdoc}

Parameters:
Name Type Description
attributes object

Attributes for the toolbar.

options object

Options for the toolbar.

Source:
Returns:

Returns an error message if validation failed.

Type
string | undefined