ToastUIEditorViewOnly

ToastUIEditorViewOnly

Constructor

new ToastUIEditorViewOnly(options)

Parameters:
Name Type Description
options object

Option object

Properties
Name Type Description
initialValue string

Editor's initial value

events object

eventlist Event list

Properties
Name Type Description
load function

It would be emitted when editor fully load

change function

It would be emitted when content changed

stateChange function

It would be emitted when format change by cursor position

focus function

It would be emitted when editor get focus

blur function

It would be emitted when editor loose focus

hooks object

Hook list

Properties
Name Type Description
previewBeforeHook function

Submit preview to hook URL before preview be shown

Methods

addHook(type, handler)

Add hook to ViewOnly preview's event

Parameters:
Name Type Description
type string

Event type

handler function

Event handler

isMarkdownMode() → {boolean}

Return false

Returns:
boolean

isViewOnly() → {boolean}

Return true

Returns:
boolean

isWysiwygMode() → {boolean}

Return false

Returns:
boolean

off(type)

Unbind eventHandler from event type

Parameters:
Name Type Description
type string

Event type

on(type, handler)

Bind eventHandler to event type

Parameters:
Name Type Description
type string

Event type

handler function

Event handler

remove()

Remove ViewOnly preview from document

setMarkdown(markdown)

Set content for preview

Parameters:
Name Type Description
markdown string

Markdown text

setValue(markdown)

Set content for preview

Parameters:
Name Type Description
markdown string

Markdown text

Deprecated:
  • Yes