Expand all

ve.ui.PreviewElement

Extends

Constructor

new ve.ui.PreviewElement([model], [config]) #

Creates a ve.ui.PreviewElement object.

Parameters:

Name Type Attributes Description
model ve.dm.Node optional

Model from which to create a preview

config Object optional

Configuration options

Properties:
Name Type Attributes Default Description
useView boolean optional
false

Use the view HTML, and don't bother generating model HTML, which is a bit slower

Mixes in:
Source:
Creates a ve.ui.PreviewElement object.

Methods

afterRender() #

Cleanup and emit events after render

Source:

Fires:

Cleanup and emit events after render

beforeAppend(element) #

Modify DOM node before appending to the preview

Parameters:

Name Type Description
element HTMLElement

Element to be appended

Source:
Modify DOM node before appending to the preview

destroy() #

Destroy the preview node.

Source:
Destroy the preview node.

isGenerating() → {boolean} #

Check if the preview is still generating

Source:

Returns:

Still generating

Type
boolean
Check if the preview is still generating

replaceWithModelDom() #

Replace the content of the body with the model DOM

Doesn't use jQuery to avoid document switching performance bug

Source:

Replace the content of the body with the model DOM

Doesn't use jQuery to avoid document switching performance bug

setModel(model) #

Set the model node for the preview

Parameters:

Name Type Description
model ve.dm.Node

Model from which to create a preview

Source:
Set the model node for the preview

updatePreview() #

Update the preview

Events

render() #

The element rendering has been updated

Source:
The element rendering has been updated