Namespace: offCanvas

Drupal.offCanvas

Off-canvas dialog implementation using jQuery Dialog.

Transforms the regular dialogs created using Drupal.dialog when the dialog element equals '#drupal-off-canvas' into an side-loading dialog.

Source:

Members

(static) $mainCanvasWrapper :jQuery

Wrapper used to position off-canvas dialog.

Type:
Source:

(static) minDisplaceWidth :Number

The minimum width to use body displace needs to match the width at which the tray will be 100% width. @see core/misc/dialog/off-canvas.css

Type:
  • Number
Source:

(static) minimumHeight :Number

The minimum height of the tray when opened at the top of the page.

Type:
  • Number
Source:

(static, nullable) position :String

Storage for position information about the tray.

Type:
  • String
Source:

Methods

(static) afterCreate($element, settings) → {undefined}

Handler fired when an off-canvas dialog has been opened.

Parameters:
Name Type Description
$element jQuery

The off-canvas dialog element.

settings Object

Settings related to the composition of the dialog.

Source:
Returns:
Type
undefined

(static) beforeClose() → {undefined}

Handler fired after an off-canvas dialog has been closed.

Source:
Returns:
Type
undefined

(static) beforeCreate(settings) → {undefined}

Handler fired before an off-canvas dialog has been opened.

Parameters:
Name Type Description
settings Object

Settings related to the composition of the dialog.

Source:
Returns:
Type
undefined

(static) bodyPadding(event)

Adjusts the body padding when the dialog is resized.

Parameters:
Name Type Description
event jQuery.Event

The event triggered.

Properties
Name Type Description
data object

Data attached to the event.

Source:

(static) getContainer($element) → {HTMLElement}

The HTML element that surrounds the dialog.

Parameters:
Name Type Description
$element HTMLElement

The dialog element.

Source:
Returns:

The containing element.

Type
HTMLElement

(static) getEdge() → {string}

The edge of the screen that the dialog should appear on.

Source:
Returns:

The edge the tray will be shown on, left or right.

Type
string

(static) handleDialogResize(event)

Adjusts the dialog on resize.

Parameters:
Name Type Description
event jQuery.Event

The event triggered.

Properties
Name Type Description
data object

Data attached to the event.

Source:

(static) isOffCanvas($element) → {bool}

Determines if an element is an off-canvas dialog.

Parameters:
Name Type Description
$element jQuery

The dialog element.

Source:
Returns:

True this is currently an off-canvas dialog.

Type
bool

(static) removeOffCanvasEvents($element)

Remove off-canvas dialog events.

Parameters:
Name Type Description
$element jQuery

The target element.

Source:

(static) render(settings) → {undefined}

Toggle classes based on title existence. Called with Drupal.offCanvas.afterCreate.

Parameters:
Name Type Description
settings Object

Settings related to the composition of the dialog.

Source:
Returns:
Type
undefined

(static) resetPadding()

Resets main canvas wrapper and toolbar padding / margin.

Source:

(static) resetSize(event)

Resets the size of the dialog.

Parameters:
Name Type Description
event jQuery.Event

The event triggered.

Properties
Name Type Description
data object

Data attached to the event.

Source: