StaticgetRetrieve an existing widget by element and ID.
StaticregisterIf no actions are supplied, nothing is done.
LisnUsageError If the config is invalid.
ReadonlydestroyUndoes all modifications to the element and returns it to its original state.
You will need to recreate it if you want to enable its functionality again.
ReadonlydisableDisables the functionality of the widget. What this means is specific to each widget.
ReadonlyenableRe-enables the functionality of the widget. What this means is specific to each widget.
ReadonlygetReturns the trigger's actions.
ReadonlygetReturns the trigger config.
ReadonlygetReturns the element passed to the widget constructor.
ReadonlyisReturns true if the widget is destroyed.
ReadonlyisReturns true if the widget is currently disabled.
ReadonlyonThe given handler will be called when the widget is destroyed.
ReadonlyonThe given handler will be called when the widget is disabled.
ReadonlyonThe given handler will be called when the widget is enabled.
Readonlyreverse"Undo"es all the Actions linked to the trigger.
Readonlyrun"Do"es all the Actions linked to the trigger.
Readonlytoggle"Toggle"s all the Actions linked to the trigger.
ReadonlytoggleRe-enables the widget if disabled, otherwise disables it.
LayoutTrigger allows you to run actions when the viewport or a target element's width or aspect ratio matches a given specification, and undo those actions when the target's width or aspect ratio no longer matches.
To use with auto-widgets (HTML API), see registerTrigger for the specification.
Arguments (required): A single DeviceSpec or AspectRatioSpec (see LayoutTriggerConfig.layout). In this case you can use a dash ("-") instead of space if needed (for example if using CSS classes instead of data attributes), e.g. "min-tablet" instead of "min tablet".
Additional trigger options (see LayoutTriggerConfig:
root: A string element specification. See getReferenceElement.Example
Show the element when the window width matches "tablet" breakpoint, hide otherwise:
Example
As above, but using a CSS class instead of data attribute:
Example
Show the element 1000ms after the window width matches "tablet" breakpoint, hide otherwise:
Example
Add class
tabletwhen the window width is at least "tablet", hide otherwise:Example
Add class
mobilewhen the window width is "mobile" or mobile-wide, add classtablet, when it's "tablet" and so on; undo that otherwise:Example
Show the element when window width is at least "mobile-wide" and at most "tablet", hide otherwise:
Example
When the aspect ratio of the next element with class
boxis square, then add classesc1andc2to the element (that the trigger is defined on) and enable triggermy-triggerdefined on this same element; undo all of that otherwise (on other aspect ratios of the reference root):Example
As above, but using
data-lisn-refattribute instead of class selector.