Module: alfresco/renderers/Favourite

alfresco/renderers/Favourite

Author:
  • Dave Draper
License:
Source:

Members

cssRequirements :object[]

An array of the CSS files to use with this widget.
Type:
  • object[]
Default Value:
  • [{cssFile:"./css/Favourite.css"}]
Source:

i18nRequirements :object[]

An array of the i18n files to use with this widget.
Type:
  • object[]
Default Value:
  • [{i18nFile: "./i18n/Favourite.properties"}]
Source:

offLabel :string

The label to show when the toggle is on
Type:
  • string
Default Value:
  • "favourite.add.label"
Source:

offTooltip :string

Override this to add a specific image for the "on" state.
Type:
  • string
Default Value:
  • "favourite.add.tooltip"
Source:

onLabel :string

The label to show when the toggle is on
Type:
  • string
Source:

onTooltip :string

The tooltip to show when the toggle is on
Type:
  • string
Default Value:
  • "favourite.remove.tooltip"
Source:

propertyToRender :string

Sets a default dot-notation property in the current item to use to render the initial state.
Type:
  • string
Default Value:
  • "isFavourite"
Source:

toggleClass :string

The CSS class to apply for the on display
Type:
  • string
Default Value:
  • "favourite"
Source:

Methods

postCreate()

Extends the inherted function to create additional subscriptions to the toggleOnSuccessTopic and [toggleOffSuccessTopic]{@link module::alfresco/renderers/Toggle#toggleOffSuccessTopic} in order to track bulk adding and removing of favourites.
Since:
  • 1.0.38
Source:
Listens to Events:
  • alfresco/renderers/Toggle#event:toggleOnSuccessTopic
  • alfresco/renderers/Toggle#event:toggleOffSuccessTopic

postMixInProperties()

Extends to add the count of all likes.
Source:

<inner> onBulkUpdate(add, payload)

This function evaluates whether or not a bulk add or remove favourite operation effects the Node rendered by the current instance and if so, calls the appropriate functions to update the rendering accordingly.
Parameters:
Name Type Description
add boolean Indicates whether or not the bulk change was to add favourites
payload object The payload from the bulk update publication.
Since:
  • 1.0.38
Source: