Module: alfresco/layout/DynamicVisibilityResizingMixin

alfresco/layout/DynamicVisibilityResizingMixin

This module has been created to be mixed into layout modules that need to resize themselves as their child widgets are dynamically displayed or hidden. The getVisibilityRuleTopics function should be called before widgets are created (i.e. before any call to processWidgets) and the subscribeToVisibilityRuleTopics function should be called after widget processing has been completed (i.e. in an extension to allWidgetsProcessed).
Since:
  • 1.0.38
Author:
  • Dave Draper
License:
Source:

Members

visibilityRuleTopics :string[]

This array is setup when the getVisibilityRuleTopics is called and each topic is then subscribed to in order to trigger resize events when widgets are displayed or hidden.
Type:
  • string[]
Default Value:
  • null
Source:

Methods

getVisibilityRuleTopics(widgets) → {string[]}

This function can be called to check all the supplied widgets for dynamic visibility configuration so that subscriptions can be created on the same rules to trigger resizing as widgets are displayed or hidden.
Parameters:
Name Type Description
widgets object[] The widgets to check for visibility/invisibility configuration
Source:
Returns:
An array of the topics that are using in dynamic visibility/invisibility configuration
Type
string[]

subscribeToVisibilityRuleTopics(func)

Iterates over the visibilityRuleTopics and creates a subscription for each one bound to the supplied function.
Parameters:
Name Type Description
func function The function to bind each subscription to.
Source: