Class: FragmentPreview

FragmentPreview()

Renders the preview of a fragment and allows modifications to the preview.

Constructor

new FragmentPreview()

Source:

Members

(static, non-null) STATE :Object

State definition.
Type:
  • Object
Source:

(protected, nullable) _currentPreviewSize :string

Ratio of the preview being rendered. This property is modified internally with the UI buttons presented to the user, but it can be safely altered externally.
Type:
  • string
Default Value:
  • 'full'
Source:

(protected) _loading :boolean

Flag that checks if the preview content is loading.
Type:
  • boolean
Default Value:
  • false
Source:

(protected, nullable) _previewSizes :Array.<string>

List of available sizes.
Type:
  • Array.<string>
Default Value:
  • PREVIEW_SIZES
Source:

(non-null) configuration :string

Configuration content of the preview.
Type:
  • string
Source:

(non-null) css :string

CSS content of the preview.
Type:
  • string
Source:

(non-null) html :string

HTML content of the preview.
Type:
  • string
Source:

(non-null) js :string

JS content of the preview.
Type:
  • string
Source:

urls :Object

URLs used for communicating with the back-end logic.
Type:
  • Object
Source:

Methods

_handleIframeClick(event)

Handle iframe clicks, preventing any click event to be executed
Parameters:
Name Type Description
event Event
Source:

(protected) _handlePreviewSizeButtonClick(event)

Changes the preview size.
Parameters:
Name Type Description
event Event
Source:

(protected) _setPreviewSize(previewSize) → {string}

Sets the preview size property and queues an update.
Parameters:
Name Type Description
previewSize string
Source:
Returns:
Type
string

(protected) _updatePreview()

Updates the rendered preview with the given content. It encapsulates the given code inside a frame and renders it.
Source:

(protected) _updatePreviewSize()

Updates the preview size using the corresponding ratio.
Source:

attached()

Source:

detached()

Source:

shouldUpdate()

Source: