PopupCodeBlockLanguages(options)

Class Popup code block languages select list

new PopupCodeBlockLanguages(options)

Creates an instance of PopupCodeBlockLanguages.

Parameters:
Name Type Description
options LayerPopupOption

layer popup option

Extends

Methods

protected _initDOM()

initialize DOM, render popup

Overrides:

protected _initDOMEvent()

bind DOM events

Overrides:

abstract, protected _initEditorEvent()

bind editor events

Overrides:

protected _initInstance(options)

init instance.
store properties & prepare before initialize DOM

Parameters:
Name Type Description
options LayerPopupOption

layer popup options

Overrides:

destroy()

destroy

Inherited From:

getCurrentLanguage() → {string}

current language

Returns:
string -

language

getTitleElement() → {HTMLElement}

get title element

Returns:
HTMLElement -
  • title html element
Inherited From:

protected hide()

hide popup

Overrides:

protected isFitToWindow() → {boolean}

make popup size fit to window

Returns:
boolean -
  • true for fit to window
Inherited From:

isShow() → {boolean}

whether this popup is visible

Returns:
boolean -
  • true: shown, false: hidden
Inherited From:

next()

move to next language

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:

prev()

move to prev language

remove()

remove popup content

Inherited From:

setContent($content)

set popup content

Parameters:
Name Type Description
$content jQuery | HTMLElement | string

content

Inherited From:

setCurrentLanguage(language)

set current language

Parameters:
Name Type Description
language string

current language

protected setFitToWindow(fit)

make popup size fit to window

Parameters:
Name Type Description
fit boolean

true to make popup fit to window

Inherited From:

setTitle(title)

set title

Parameters:
Name Type Description
title string

title text

Inherited From:

protected show(callback)

show popup

Parameters:
Name Type Description
callback object

to be called on language selected & dismissed

Overrides:

protected toggleFitToWindow() → {boolean}

toggle size fit to window

Returns:
boolean -
  • true for fit to window
Inherited From:

trigger(…args)

trigger event

Parameters:
Name Type Attributes Description
args object <repeatable>

event name & extra params

Inherited From: