Namespace: ContentFrame

Granite.author. ContentFrame

ContentFrame module responsible for the edited content by opposition to the content of the EditorFrame

An iframe embeds the content of the page to be edited

Source:
ContentFrame.js

Members


<static> iframe :jQuery

The iframe object of the outer document.

It embeds the page to edit

Type:
  • jQuery
Source:
ContentFrame.js

<static> location

Keeps track of the URL of the content that is currently loaded in the iframe

Source:
ContentFrame.js

Methods


<static> currentLocation()

Returns the current location of the iframe

Source:
ContentFrame.js

<static> getDocument()

Returns the current document of the iframe

Source:
ContentFrame.js
Returns:
  • the iframe's document
Type
jQuery

<static> getEditableConfigNode(path)

Returns the HTML node corresponding to the Editable config in the iframe for a given path

Parameters:
Name Type Description
path string

data-path attribute value of the editable

Source:
ContentFrame.js
Returns:
Type
jQuery

<static> getEditableNode(path)

Returns the HTML node in the iframe corresponding to the Editable for a given path

Parameters:
Name Type Description
path string

data-path attribute value of the editable

Source:
ContentFrame.js
Returns:
Type
jQuery

<static> getEditables(root)

Returns all the Editables present in the iframe document

Parameters:
Name Type Argument Description
root jQuery <optional>

node or document

Source:
ContentFrame.js
Returns:
Type
Array.<Granite.author.Editable>

<static> init()

Initialize the ContentFrame by loading the content page, and subscribing to messages sent by the iframe.
NB: This interacts with the scripts included by the content page (defined in cq.authoring.page)

Source:
ContentFrame.js
Fires:
  • Document#event:cq-contentframe-layout-change

<static> load(url)

Make the iframe load the given URL

Parameters:
Name Type Description
url string

URL to be loaded

Source:
ContentFrame.js

<static> loadEditables()

Loads all the Editables

Source:
ContentFrame.js
Fires:
Returns:

An array of all Granite.author.Editables in the content frame

Type
Array.<Granite.author.Editable>

<static> reload()

Reloads the current URL

Source:
ContentFrame.js

<static> resetContentHeight()

Resets the height of the ContentWrapper and ContentFrame; used to adjust the iframe height when a change occurs inside of the content page
This is called on cq-contentframe-layout-change event

Source:
ContentFrame.js

<static> setFindEditablesFunction(func)

Provides a function to be used when exploring the DOM for Granite.author.Editables

Parameters:
Name Type Description
func function

The function responsible for providing a list of Granite.author.Editable

Source:
ContentFrame.js
See:
  • ContentFrame.getEditables

<static> showPlaceholder(condition)

Toggle all the placeholders elements of the iframe

NB: This causes a full rendering of the inner document

Parameters:
Name Type Description
condition boolean

Should the placeholders be displayed

Source:
ContentFrame.js