Module: alfresco/layout/HeightMixin

alfresco/layout/HeightMixin

This mixin module provides functions for setting the height of a widget based on a configured heightMode attribute. By default the standard approach is for the height to consume the available space from it's initial position down to the bottom of the screen (assuming the page is initially displayed from the start of the page). However it is also possible to specify that the height should be taken from a dialog in which the widget is placed or for it to be given a specific height or (if a negative value is provided) for a number of pixels to be deducted from the available height.
Since:
  • 1.0.34
Author:
  • Dave Draper
License:
Source:

Members

heightAdjustment :number

This property allows for the height being set to be compensated for a number of different factors such as sticky footers or configured padding or margins that might increase the height of the widget DOM element.
Type:
  • number
Default Value:
  • 0
Source:

heightMode :string|number

This should be configured to indicate how the height of the widget should be calculated.

  • "AUTO" (the default) indicates that the height will be calculated to be the available space from the widgets position to the bottom of the screen (minus any heightAdjustment).
  • "DIALOG" indicates that the height should be taken from the available height of the dialog in which the widget is displayed.
  • Any negative number indicates that the "AUTO" height minus the supplied value will be used.
  • Any positive number indicates a fixed height (in pixels) that should be used for the height

Type:
  • string | number
Default Value:
  • "AUTO"
Source:

Methods

calculateDialogHeight(domNode) → {number|promise}

Calculates the height when heightMode is "DIALOG".
Parameters:
Name Type Description
domNode element The DOM element to calculate the height for.
Since:
  • 1.0.36
Source:
Returns:
Either an actual height or a promise of the height
Type
number | promise

calculateHeight(domNode) → {number|promise}

Calculates the height of the supplied element based on the available space using the configured heightMode setting.
Parameters:
Name Type Description
domNode element The DOM element to calculate the height for.
Source:
Returns:
Either an actual height or a promise of the height (when using the "DIALOG" height mode)
Type
number | promise

calculateParentHeight(domNode) → {number|promise}

Calculates the height when heightMode is "PARENT".
Parameters:
Name Type Description
domNode element The DOM element to calculate the height for.
Since:
  • 1.0.36
Source:
Returns:
Either an actual height or a promise of the height
Type
number | promise

setHeight(domNode)

This sets the height of the supplied DOM element with the height returned from a call to the calculateHeight function.
Parameters:
Name Type Description
domNode element The DOM element to set the height for.
Source: