ToolbarCollection

modules/toolbar/collection.ToolbarCollection

The base class of all Jodit UI components. Provides work with a life cycle.

Type parameters

Name Type
T extends IViewWithToolbar = IViewWithToolbar

Hierarchy

Implements

constructor

new ToolbarCollection<T>(jodit): ToolbarCollection<T>

Type parameters

Name Type
T extends IViewWithToolbar<IViewOptions> = IViewWithToolbar<IViewOptions>

Parameters

Name Type
jodit IViewBased<IViewOptions>

Returns

ToolbarCollection<T>

Overrides

UIList.constructor

Defined in

src/modules/toolbar/collection/collection.ts#115

STATUSES

Static STATUSES: Object = STATUSES

Type declaration

Name Type
beforeInit "beforeInit"
ready "ready"
beforeDestruct "beforeDestruct"
destructed "destructed"

Inherited from

UIList.STATUSES

Defined in

src/core/component/component.ts#40


async

async: IAsync

Implementation of

IToolbarCollection.async

Inherited from

UIList.async

Defined in

src/core/component/component.ts#44


uid

Readonly uid: string

Implementation of

IToolbarCollection.uid

Inherited from

UIList.uid

Defined in

src/core/component/component.ts#59


ownerWindow

ownerWindow: Window = window

The window in which jodit was created

Implementation of

IToolbarCollection.ownerWindow

Inherited from

UIList.ownerWindow

Defined in

src/core/component/component.ts#109


container

container: HTMLElement

Implementation of

IToolbarCollection.container

Inherited from

UIList.container

Defined in

src/core/ui/element.ts#32


name

name: string = ''

Implementation of

IToolbarCollection.name

Inherited from

UIList.name

Defined in

src/core/ui/element.ts#33


mods

Readonly mods: IDictionary<null | string | boolean> = {}

Implementation of

IToolbarCollection.mods

Inherited from

UIList.mods

Defined in

src/core/ui/element.ts#119


syncMod

syncMod: boolean = false

Synchronize mods to all children

Inherited from

UIList.syncMod

Defined in

src/core/ui/group/group.ts#42


elements

elements: IUIElement[] = []

Implementation of

IToolbarCollection.elements

Inherited from

UIList.elements

Defined in

src/core/ui/group/group.ts#44


buttonSize

buttonSize: "small" | "tiny" | "xsmall" | "middle" | "large" = 'middle'

Implementation of

IToolbarCollection.buttonSize

Inherited from

UIList.buttonSize

Defined in

src/core/ui/group/group.ts#71


options

Optional Readonly options: IDictionary

Inherited from

UIList.options

Defined in

src/core/ui/group/group.ts#155


jodit

jodit: T

Parent View element

Implementation of

IToolbarCollection.jodit

Inherited from

UIList.jodit

Defined in

src/core/ui/group/list.ts#44


mode

mode: "vertical" | "horizontal" = 'horizontal'

Implementation of

IToolbarCollection.mode

Inherited from

UIList.mode

Defined in

src/core/ui/group/list.ts#46

componentName

get componentName(): string

Returns

string

Implementation of

IToolbarCollection.componentName

Inherited from

UIList.componentName

Defined in

src/core/component/component.ts#46


ownerDocument

get ownerDocument(): Document

The document in which jodit was created

Returns

Document

Implementation of

IToolbarCollection.ownerDocument

Inherited from

UIList.ownerDocument

Defined in

src/core/component/component.ts#95


od

get od(): Document

Shortcut for this.ownerDocument

Returns

Document

Implementation of

IToolbarCollection.od

Inherited from

UIList.od

Defined in

src/core/component/component.ts#102


ow

get ow(): Window

Returns

Window

Implementation of

IToolbarCollection.ow

Inherited from

UIList.ow

Defined in

src/core/component/component.ts#110


isReady

get isReady(): boolean

Component is ready for work

Returns

boolean

Implementation of

IToolbarCollection.isReady

Inherited from

UIList.isReady

Defined in

src/core/component/component.ts#145


isDestructed

get isDestructed(): boolean

Component was destructed

Returns

boolean

Implementation of

IToolbarCollection.isDestructed

Inherited from

UIList.isDestructed

Defined in

src/core/component/component.ts#152


isInDestruct

get isInDestruct(): boolean

The component is currently undergoing destructuring or has already been destroyed.
Those. you should not the app froze new events on him now or do anything else with him.

Returns

boolean

Implementation of

IToolbarCollection.isInDestruct

Inherited from

UIList.isInDestruct

Defined in

src/core/component/component.ts#160


componentStatus

get componentStatus(): ComponentStatus

Current component status

Returns

ComponentStatus

Implementation of

IToolbarCollection.componentStatus

Inherited from

UIList.componentStatus

Defined in

src/core/component/component.ts#210

set componentStatus(componentStatus): void

Setter for current component status

Parameters

Name Type
componentStatus ComponentStatus

Returns

void

Implementation of

IToolbarCollection.componentStatus

Inherited from

UIList.componentStatus

Defined in

src/core/component/component.ts#217


j

get j(): T

Shortcut for this.jodit

Returns

T

Implementation of

IToolbarCollection.j

Inherited from

UIList.j

Defined in

src/core/component/view-component.ts#27


defaultTimeout

get defaultTimeout(): number

Returns

number

Implementation of

IToolbarCollection.defaultTimeout

Inherited from

UIList.defaultTimeout

Defined in

src/core/component/view-component.ts#31


parentElement

get parentElement(): Nullable<IUIElement>

Returns

Nullable<IUIElement>

Implementation of

IToolbarCollection.parentElement

Inherited from

UIList.parentElement

Defined in

src/core/ui/element.ts#37

set parentElement(parentElement): void

Parameters

Name Type
parentElement Nullable<IUIElement>

Returns

void

Implementation of

IToolbarCollection.parentElement

Inherited from

UIList.parentElement

Defined in

src/core/ui/element.ts#41


allChildren

get allChildren(): IUIElement[]

All group children

Returns

IUIElement[]

Implementation of

IToolbarCollection.allChildren

Inherited from

UIList.allChildren

Defined in

src/core/ui/group/group.ts#49


buttons

get buttons(): IUIButton[]

All buttons from list

Returns

IUIButton[]

Implementation of

IToolbarCollection.buttons

Inherited from

UIList.buttons

Defined in

src/core/ui/group/list.ts#68


firstButton

get firstButton(): Nullable<IToolbarButton>

First button in a list

Returns

Nullable<IToolbarButton>

Implementation of

IToolbarCollection.firstButton

Defined in

src/modules/toolbar/collection/collection.ts#49

getFullElName

getFullElName(elementName): string

Calc BEM element class name

Parameters

Name Type Description
elementName string element name in the bem classification

Returns

string

Implementation of

IToolbarCollection.getFullElName

Inherited from

UIList.getFullElName

Defined in

src/core/component/component.ts#65

getFullElName(elementName, mod): string

Parameters

Name Type
elementName string
mod string

Returns

string

Implementation of

IToolbarCollection.getFullElName

Inherited from

UIList.getFullElName

Defined in

src/core/component/component.ts#66

getFullElName(elementName, mod, modValue): string

Parameters

Name Type
elementName string
mod string
modValue string | boolean

Returns

string

Implementation of

IToolbarCollection.getFullElName

Inherited from

UIList.getFullElName

Defined in

src/core/component/component.ts#67


bindDestruct

bindDestruct(component): this

Bind destructor to some View

Parameters

Name Type
component IComponent<IViewBased<IViewOptions>>

Returns

this

Implementation of

IToolbarCollection.bindDestruct

Inherited from

UIList.bindDestruct

Defined in

src/core/component/component.ts#170


setStatus

setStatus(componentStatus): void

Set component status

Parameters

Name Type Description
componentStatus ComponentStatus component status

Returns

void

See

ComponentStatus

Implementation of

IToolbarCollection.setStatus

Inherited from

UIList.setStatus

Defined in

src/core/component/component.ts#226


hookStatus

hookStatus(status, callback): void

Adds a handler for changing the component's status

Parameters

Name Type Description
status ComponentStatus the status at which the callback is triggered
callback (component: this) => void a function that will be called when the status is status

Returns

void

Implementation of

IToolbarCollection.hookStatus

Inherited from

UIList.hookStatus

Defined in

src/core/component/component.ts#265


isInstanceOf

isInstanceOf<T>(c, constructorFunc): c is T

Type parameters

Name Type
T extends Component

Parameters

Name Type
c unknown
constructorFunc Function

Returns

c is T

Inherited from

UIList.isInstanceOf

Defined in

src/core/component/component.ts#283


i18n

i18n(text, ...params): string

Parameters

Name Type
text string
...params (string | number)[]

Returns

string

Implementation of

IToolbarCollection.i18n

Inherited from

UIList.i18n

Defined in

src/core/component/view-component.ts#35


setParentView

setParentView(jodit): this

Attach component to View

Parameters

Name Type
jodit T

Returns

this

Implementation of

IToolbarCollection.setParentView

Inherited from

UIList.setParentView

Defined in

src/core/component/view-component.ts#42


getElm

getElm<T>(this, elementName): Nullable<HTMLElement>

Return element with BEM class name

Type parameters

Name Type
T extends IComponent<IViewBased<IViewOptions>> & IContainer & IElms

Parameters

Name Type
this T
elementName string

Returns

Nullable<HTMLElement>

Implementation of

IToolbarCollection.getElm

Inherited from

UIList.getElm

Defined in

src/core/traits/elms.ts#18


getElms

getElms<T>(this, elementName): HTMLElement[]

Return elements with BEM class name

Type parameters

Name Type
T extends IComponent<IViewBased<IViewOptions>> & IContainer & IElms

Parameters

Name Type
this T
elementName string

Returns

HTMLElement[]

Implementation of

IToolbarCollection.getElms

Inherited from

UIList.getElms

Defined in

src/core/traits/elms.ts#30


setMod

setMod<T>(this, name, value, container?): T

Set/remove BEM class modification

Type parameters

Name Type
T extends IComponent<IViewBased<IViewOptions>> & IContainer & IMods

Parameters

Name Type Description
this T -
name string -
value ModType if null, mod will be removed
container? HTMLElement -

Returns

T

Implementation of

IToolbarCollection.setMod

Inherited from

UIList.setMod

Defined in

src/core/traits/mods.ts#30


getMod

getMod(this, name): ModType

Get BEM class modification value

Parameters

Name Type
this IMods
name string

Returns

ModType

Implementation of

IToolbarCollection.getMod

Inherited from

UIList.getMod

Defined in

src/core/traits/mods.ts#64


bubble

bubble(callback): this

Apply callback for all parents

Parameters

Name Type
callback (parent: IUIElement) => void

Returns

this

Implementation of

IToolbarCollection.bubble

Inherited from

UIList.bubble

Defined in

src/core/ui/element.ts#51


updateParentElement

updateParentElement(target): this

Parameters

Name Type
target IUIElement

Returns

this

Implementation of

IToolbarCollection.updateParentElement

Inherited from

UIList.updateParentElement

Defined in

src/core/ui/element.ts#62


get

get<T>(chain, obj?): Nullable<T>

Type parameters

Name
T

Parameters

Name Type
chain string
obj? IDictionary

Returns

Nullable<T>

Implementation of

IToolbarCollection.get

Inherited from

UIList.get

Defined in

src/core/ui/element.ts#68


closest

closest<T>(type): Nullable<T extends typeof UIElement ? InstanceType<T<T>> : T>

Find match parent

Type parameters

Name Type
T extends typeof UIElement | UIElement<IViewBased<IViewOptions>>

Parameters

Name Type
type Function | UIElement<IViewBased<IViewOptions>>

Returns

Nullable<T extends typeof UIElement ? InstanceType<T<T>> : T>

Implementation of

IToolbarCollection.closest

Inherited from

UIList.closest

Defined in

src/core/ui/element.ts#75


closestElement

closestElement(node, type): Nullable<IUIElement>

Find closest UIElement in DOM

Parameters

Name Type
node Node
type Function

Returns

Nullable<IUIElement>

Inherited from

UIList.closestElement

Defined in

src/core/ui/element.ts#106


appendTo

appendTo(element): this

Append container to element

Parameters

Name Type
element HTMLElement

Returns

this

Implementation of

IToolbarCollection.appendTo

Inherited from

UIList.appendTo

Defined in

src/core/ui/element.ts#131


append

append(elm, distElement?): this

Append new element into group

Parameters

Name Type
elm IUIElement | IUIElement[]
distElement? string

Returns

this

Implementation of

IToolbarCollection.append

Inherited from

UIList.append

Defined in

src/core/ui/group/group.ts#85


afterSetMod

afterSetMod(name, value): void

Parameters

Name Type
name string
value ModType

Returns

void

Implementation of

IToolbarCollection.afterSetMod

Inherited from

UIList.afterSetMod

Defined in

src/core/ui/group/group.ts#111


remove

remove(elm): this

Remove element from group

Parameters

Name Type
elm IUIElement

Returns

this

Implementation of

IToolbarCollection.remove

Inherited from

UIList.remove

Defined in

src/core/ui/group/group.ts#127


clear

clear(): this

Clear group

Returns

this

Implementation of

IToolbarCollection.clear

Inherited from

UIList.clear

Defined in

src/core/ui/group/group.ts#142


getButtonsNames

getButtonsNames(): string[]

Helper for getting full plain button list

Returns

string[]

Implementation of

IToolbarCollection.getButtonsNames

Inherited from

UIList.getButtonsNames

Defined in

src/core/ui/group/list.ts#77


setRemoveButtons

setRemoveButtons(removeButtons?): this

Parameters

Name Type
removeButtons? string[]

Returns

this

Implementation of

IToolbarCollection.setRemoveButtons

Inherited from

UIList.setRemoveButtons

Defined in

src/core/ui/group/list.ts#85


className

className(): string

Returns

string

Implementation of

IToolbarCollection.className

Overrides

UIList.className

Defined in

src/modules/toolbar/collection/collection.ts#38


shouldBeActive

shouldBeActive(button): undefined | boolean

Button should be active

Parameters

Name Type
button IToolbarButton

Returns

undefined | boolean

Implementation of

IToolbarCollection.shouldBeActive

Defined in

src/modules/toolbar/collection/collection.ts#71


shouldBeDisabled

shouldBeDisabled(button): undefined | boolean

The Button should be disabled

Parameters

Name Type
button IToolbarButton

Returns

undefined | boolean

Implementation of

IToolbarCollection.shouldBeDisabled

Defined in

src/modules/toolbar/collection/collection.ts#78


getTarget

getTarget(button): null | Node

Returns current target for button

Parameters

Name Type
button IToolbarButton

Returns

null | Node

Implementation of

IToolbarCollection.getTarget

Defined in

src/modules/toolbar/collection/collection.ts#85


update

update(): void

Update all children

Returns

void

Implementation of

IToolbarCollection.update

Overrides

UIList.update

Defined in

src/modules/toolbar/collection/collection.ts#101


setDirection

setDirection(direction): void

Set direction

Parameters

Name Type
direction "rtl" | "ltr"

Returns

void

Implementation of

IToolbarCollection.setDirection

Defined in

src/modules/toolbar/collection/collection.ts#108


hide

hide(): void

Returns

void

Implementation of

IToolbarCollection.hide

Defined in

src/modules/toolbar/collection/collection.ts#126


show

show(): void

Returns

void

Implementation of

IToolbarCollection.show

Defined in

src/modules/toolbar/collection/collection.ts#130


showInline

showInline(bound?): void

Parameters

Name Type
bound? IBound

Returns

void

Implementation of

IToolbarCollection.showInline

Defined in

src/modules/toolbar/collection/collection.ts#134


build

build(items, target?): this

Parameters

Name Type Default value
items ButtonsGroups undefined
target Nullable<HTMLElement> null

Returns

this

Implementation of

IToolbarCollection.build

Overrides

UIList.build

Defined in

src/modules/toolbar/collection/collection.ts#139


destruct

destruct(): void

Returns

void

Implementation of

IToolbarCollection.destruct

Overrides

UIList.destruct

Defined in

jodit/src/modules/toolbar/collection/collection.ts:157