ModeSwitch($rootElement, initialType)

Class ModeSwitch
UI Control for switch between Markdown and WYSIWYG

new ModeSwitch($rootElement, initialType)

Creates an instance of ModeSwitch.

Parameters:
Name Type Description
$rootElement jQuery

root jquery element

initialType string

initial type of editor

Extends

Members

static TYPE

mode switch type

Properties:
Name Type Description
MARKDOWN string

Markdown

WYSIWYG string

WYSIWYG

_$rootElement :jQuery

root element

Methods

destroy()

destroy

Inherited From:

hide()

hide switch tab bar

isShown() → {Boolean}

is the switch tab bar shown

Returns:
Boolean -
  • showing status

off(type, fn)

unbind event handler

Parameters:
Name Type Description
type string

event name and selector

fn function

handler function

Inherited From:

on(aType, aFn)

Parameters:
Name Type Description
aType string | object

event name and selector string

aFn function

event handler

Inherited From:

remove()

remove

Inherited From:

show()

show switch tab bar

trigger(…args)

trigger event

Parameters:
Name Type Attributes Description
args object <repeatable>

event name & extra params

Inherited From: