Module: alfresco/core/ResizeMixin

alfresco/core/ResizeMixin

This provides functions for both publishing resize payloads and handling resize subscriptions. Widgets that need to publish information about being resized (such as the AlfSideBarContainer) should call the alfPublishResizeEvent function passing the node that has been resized. Widgets that need to handle either window or containing node resize events (such as the Grid and the [Carousel]{@link module:alfresco/lists/views/layouts/Carousel} should call the call the alfSetupResizeSubscriptions function passing the handler and scope to use when resize events occur.
Author:
  • Dave Draper
License:
Source:

Members

alfResizeNodeTopic :string

The topic to use for publishing and subscribing to node resize events
Type:
  • string
Default Value:
  • NODE_RESIZED
Source:

Methods

addResizeListener(monitoredNode, resizeNode) → {object}

Setup a listener that will call alfPublishResizeEvent whenever a resize is detected in the specified node. If there is an own method on the instance, then it will be called, so that the listener is removed on widget destruction (encapsulated here to avoid widespread boilerplate-code duplication).
Parameters:
Name Type Argument Description
monitoredNode object The node to monitor
resizeNode object <optional>
The node against which to publish a resize event (defaults to monitoredNode.parentNode)
Since:
  • 1.0.42
Source:
Returns:
A pointer to the listener, with a remove function on it (i.e. it can be passed to this.own)
Type
object

alfOnNodeResized(resizeHandler, resizeHandlerCallScope, payload)

This is the handler for node resize events. If the resized node is an ancestor of the DOM node then the supplied handler will be called.
Parameters:
Name Type Description
resizeHandler function
resizeHandlerCallScope object The "this" object to use with the supplied resize handler
payload object The details of the node that has been resized.
Source:

alfPublishResizeEvent(resizedNode)

Publishes on a topic that indicates that the supplied node has been resized. By default publications will be throttled to prevent multiple resize events being published for the same node, however it is possible to provide an optional "unthrottled" argument to prevent throttling.
Parameters:
Name Type Description
resizedNode object The node that has been resized
Source:
Fires:
  • module:alfresco/core/ResizeMixin#event:alfResizeNodeTopic

alfSetupResizeSubscriptions(resizeHandler, resizeHandlerCallScope)

Sets up common subscriptions for handling resize events.
Parameters:
Name Type Description
resizeHandler function
resizeHandlerCallScope object The "this" object to use with the supplied resize handler
Source:
Listens to Events:
  • module:alfresco/core/ResizeMixin#event:alfResizeNodeTopic