Namespace: editableHelper

Granite.author. editableHelper

Provides CRUD operations and helper functions over instances of Granite.author.Editable or implying Granite.author.Editable instances.
Those operations are mostly outside the usual scope of the state update of a variable instance.
NB: The Toolbar actions are now defined per layer: see Granite.author.edit.ToolbarActions for instance

Source:
editableHelper.js

Members


<static> self.actions :Object

The object containing the Granite.author.ui.EditableActions (Layer dependant)

Type:
  • Object
Source:
editableHelper.js

Methods


<static> self.getInheritedStyleEntry(editable, propertyName, suffix)

Returns the style entry from Granite.author.pageDesign for the parents of the given Editable of the same resource type

Parameters:
Name Type Description
editable
propertyName
suffix
Source:
editableHelper.js
Returns:
Type
*

<static> self.getStyleEntry(path)

Returns the style entry from Granite.author.pageDesign for the given path

Parameters:
Name Type Description
path string

Path to the design entry

Source:
editableHelper.js
Returns:
  • The style entry
Type
Object

<static> self.getStyleProperty(editable, name)

Returns the style property for the given design cell.

Parameters:
Name Type Description
editable Granite.author.Editable

Granite.author.Editable from which we want to get a style property value

name String

Name of the entry/property

Source:
editableHelper.js
Returns:

inheritStyle - Should the design be inherited from the closest parent of the same resource type

Type
boolean | null

<static> self.loadContent(editable, url)

Loads a content from a given URL and replaces the editable's DOM with the returned content

Parameters:
Name Type Description
editable Granite.author.Editable

Granite.author.Editable that we would like to update

url string

-

Source:
editableHelper.js
Returns:
  • Will be either resolved or rejected depending on the success of the operation
Type
$.Promise

<static> self.setContent(editable, content)

Replaces the Editable's DOM with the given content

Parameters:
Name Type Description
editable Granite.author.Editable

Granite.author.Editable for which the underlying content should be updated

content HTMLElement

New content

Source:
editableHelper.js
Returns:
  • Will be either resolved or rejected depending on the success of the operation
Type
$.Promise

<static> self.setUp(actions)

Sets the available actions for the current context/Layer

Parameters:
Name Type Description
actions

The object containing the Granite.author.ui.EditableActions

Source:
editableHelper.js

<static> self.tearDown()

Unsets the available actions for the current context/Layer

Source:
editableHelper.js

<private, static> self.updateDom(component, dom)

Updates passed DOM based on the Editable's configuration

Parameters:
Name Type Description
component Granite.author.Component
dom String | HTMLElement
Source:
editableHelper.js
Returns:

modified dom

Type
String