Class: PreviewLayer

Granite.author. PreviewLayer

The Preview Layer provides a quick preview of the content page to the author.

Among with the Edit Layer, it's one of the two main Layers of the Editor.

WARNING: The Preview Layer sets the WCMMode to "Preview" but doesn't refresh the content from the ContentFrame. In other words, if you have some WCMMode rendering sensitive components, you'll have to refresh the Editor manually after switching to Preview (alternatively, you could also use the "View as Published" top toolbar action)


new PreviewLayer()

Source:
layers/PreviewLayer.js

Extends

Members


config :LayerConfig

The default Layer Configuration that will be used to configure the Layer behavior.

Subclasses should override this object instead of overriding Layer#activate and Layer#deactivate methods. If additional adjustments are needed (that aren't configurable yet in the activate method), please leverage the setUp and tearDown methods.

For an example of a Layer configuration object, refer to edit.CONFIG

Type:
Inherited From:
Overrides:
Source:
layers/Layer.js

Methods


activate()

Activates the Layer according to its configuration. It includes the following operations:

  • Loads the Editables in the store (according to config.findEditable, or the default function from the ContentFrame if this isn't configured)
  • Creates the Overlays for the Editables (according to config.overlayConstructor)
  • Sets the Editable Toolbar (according to config.toolbarConstructor + config.toolbarActions)
  • Initializes the SidePanel (according to config.sidePanel)
  • Binds the Interaction events on Overlays (according to config.interactions)

WARNING: Don't override this method since it is aimed at being configurable through the Layer configuration object. If you need to perform specific operations, refer to the setUp method.

Inherited From:
Source:
layers/Layer.js
Returns:
  • The current layer
Type
Granite.author.Layer

deactivate()

Reverts the actions executed by Granite.author.Layer#activate

WARNING: Don't override this method since it is aimed at being configurable through the Layer configuration object. If you need to perform specific operations, refer to the tearDown method.

Inherited From:
Source:
layers/Layer.js
Returns:
  • The current Layer
Type
Granite.author.Layer

isAvailable()

Indicates if the Layer is available for the current context. If the Layer isn't available, then it won't be shown in the Layer selector and won't be used in the Editor.

Inherited From:
Source:
layers/Layer.js
Returns:
  • Returns true if the Layer is available for the current context
Type
boolean

setUp()

Override this method to execute specific set up operations (in addition to the activate method)
This method is called by Granite.author.Layer#activate

Inherited From:
Overrides:
Source:
layers/Layer.js

tearDown()

Override this method to execute specific clean up operations (in addition to the deactivate method)
This method is called by Granite.author.Layer#deactivate

Inherited From:
Overrides:
Source:
layers/Layer.js