ToolbarEditorCollection
- Hierarchy
- constructor
 - STATUSES
 - async
 - uid
 - ownerWindow
 - container
 - name
 - mods
 - syncMod
 - elements
 - buttonSize
 - options
 - jodit
 - mode
 - componentName
 - ownerDocument
 - od
 - ow
 - isReady
 - isDestructed
 - isInDestruct
 - componentStatus
 - j
 - defaultTimeout
 - parentElement
 - allChildren
 - buttons
 - firstButton
 - getFullElName
 - bindDestruct
 - setStatus
 - hookStatus
 - isInstanceOf
 - i18n
 - setParentView
 - getElm
 - getElms
 - setMod
 - getMod
 - bubble
 - updateParentElement
 - get
 - closest
 - closestElement
 - appendTo
 - append
 - afterSetMod
 - remove
 - clear
 - getButtonsNames
 - setRemoveButtons
 - update
 - setDirection
 - build
 - destruct
 - className
 - shouldBeDisabled
 - shouldBeActive
 - getTarget
 - showInline
 - hide
 - show
 
 
modules/toolbar/collection.ToolbarEditorCollection
The base class of all Jodit UI components. Provides work with a life cycle.
Hierarchy
- 
↳
ToolbarEditorCollection 
constructor
new ToolbarEditorCollection(jodit): ToolbarEditorCollection
Parameters
| Name | Type | 
|---|---|
jodit | 
IJodit | 
Returns
Overrides
Defined in
src/modules/toolbar/collection/editor-collection.ts#149
STATUSES
Static STATUSES: Object = STATUSES
Type declaration
| Name | Type | 
|---|---|
beforeInit | 
"beforeInit" | 
ready | 
"ready" | 
beforeDestruct | 
"beforeDestruct" | 
destructed | 
"destructed" | 
Inherited from
Defined in
src/core/component/component.ts#40
async
async: IAsync
Inherited from
Defined in
src/core/component/component.ts#44
uid
Readonly uid: string
Inherited from
Defined in
src/core/component/component.ts#59
ownerWindow
ownerWindow: Window = window
The window in which jodit was created
Inherited from
Defined in
src/core/component/component.ts#109
container
container: HTMLElement
Inherited from
Defined in
name
name: string = ''
Inherited from
Defined in
mods
Readonly mods: IDictionary<null | string | boolean> = {}
Inherited from
Defined in
syncMod
syncMod: boolean = false
Synchronize mods to all children
Inherited from
Defined in
elements
elements: IUIElement[] = []
Inherited from
Defined in
buttonSize
buttonSize: "small" | "tiny" | "xsmall" | "middle" | "large" = 'middle'
Inherited from
Defined in
options
Optional Readonly options: IDictionary
Inherited from
Defined in
src/core/ui/group/group.ts#193
jodit
jodit: IJodit
Parent View element
Inherited from
Defined in
mode
mode: "vertical" | "horizontal" = 'horizontal'
Inherited from
Defined in
componentName
get componentName(): string
Returns
string
Inherited from
ToolbarCollection.componentName
Defined in
src/core/component/component.ts#46
ownerDocument
get ownerDocument(): Document
The document in which jodit was created
Returns
Inherited from
ToolbarCollection.ownerDocument
Defined in
src/core/component/component.ts#95
od
get od(): Document
Shortcut for this.ownerDocument
Returns
Inherited from
ToolbarCollection.od
Defined in
src/core/component/component.ts#102
ow
get ow(): Window
Returns
Inherited from
ToolbarCollection.ow
Defined in
src/core/component/component.ts#110
isReady
get isReady(): boolean
Component is ready for work
Returns
boolean
Inherited from
ToolbarCollection.isReady
Defined in
src/core/component/component.ts#145
isDestructed
get isDestructed(): boolean
Component was destructed
Returns
boolean
Inherited from
ToolbarCollection.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
Inherited from
ToolbarCollection.isInDestruct
Defined in
src/core/component/component.ts#160
componentStatus
get componentStatus(): ComponentStatus
Current component status
Returns
Inherited from
ToolbarCollection.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
Inherited from
ToolbarCollection.componentStatus
Defined in
src/core/component/component.ts#217
j
get j(): T
Shortcut for this.jodit
Returns
T
Inherited from
ToolbarCollection.j
Defined in
src/core/component/view-component.ts#27
defaultTimeout
get defaultTimeout(): number
Returns
number
Inherited from
ToolbarCollection.defaultTimeout
Defined in
src/core/component/view-component.ts#31
parentElement
get parentElement(): Nullable<IUIElement>
Returns
Inherited from
ToolbarCollection.parentElement
Defined in
set parentElement(parentElement): void
Parameters
| Name | Type | 
|---|---|
parentElement | 
Nullable<IUIElement> | 
Returns
void
Inherited from
ToolbarCollection.parentElement
Defined in
allChildren
get allChildren(): IUIElement[]
All group children
Returns
Inherited from
ToolbarCollection.allChildren
Defined in
buttons
get buttons(): IUIButton[]
All buttons from list
Returns
Inherited from
ToolbarCollection.buttons
Defined in
firstButton
get firstButton(): Nullable<IToolbarButton>
First button in a list
Returns
Inherited from
ToolbarCollection.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
Inherited from
ToolbarCollection.getFullElName
Defined in
src/core/component/component.ts#65
getFullElName(elementName, mod): string
Parameters
| Name | Type | 
|---|---|
elementName | 
string | 
mod | 
string | 
Returns
string
Inherited from
ToolbarCollection.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
Inherited from
ToolbarCollection.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
Inherited from
ToolbarCollection.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
Inherited from
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
Inherited from
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
ToolbarCollection.isInstanceOf
Defined in
src/core/component/component.ts#283
i18n
i18n(text, ...params): string
Parameters
| Name | Type | 
|---|---|
text | 
string | 
...params | 
(string | number)[] | 
Returns
string
Inherited from
Defined in
src/core/component/view-component.ts#35
setParentView
setParentView(jodit): this
Attach component to View
Parameters
| Name | Type | 
|---|---|
jodit | 
IJodit | 
Returns
this
Inherited from
ToolbarCollection.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
Inherited from
Defined in
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
Inherited from
Defined in
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
Inherited from
Defined in
getMod
getMod(this, name): ModType
Get BEM class modification value
Parameters
| Name | Type | 
|---|---|
this | 
IMods | 
name | 
string | 
Returns
Inherited from
Defined in
bubble
bubble(callback): this
Apply callback for all parents
Parameters
| Name | Type | 
|---|---|
callback | 
(parent: IUIElement) => void | 
Returns
this
Inherited from
Defined in
updateParentElement
updateParentElement(target): this
Parameters
| Name | Type | 
|---|---|
target | 
IUIElement | 
Returns
this
Inherited from
ToolbarCollection.updateParentElement
Defined in
get
get<T>(chain, obj?): Nullable<T>
Type parameters
| Name | 
|---|
T | 
Parameters
| Name | Type | 
|---|---|
chain | 
string | 
obj? | 
IDictionary | 
Returns
Nullable<T>
Inherited from
Defined in
closest
closest<T>(type): Nullable<T extends typeof UIElement ? InstanceType<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>
Inherited from
Defined in
closestElement
closestElement(node, type): Nullable<IUIElement>
Find closest UIElement in DOM
Parameters
| Name | Type | 
|---|---|
node | 
Node | 
type | 
Function | 
Returns
Inherited from
ToolbarCollection.closestElement
Defined in
appendTo
appendTo(element): this
Append container to element
Parameters
| Name | Type | 
|---|---|
element | 
HTMLElement | 
Returns
this
Inherited from
Defined in
append
append(elm, index?): this
Append new element into group
Parameters
| Name | Type | 
|---|---|
elm | 
IUIElement | 
index? | 
number | 
Returns
this
Inherited from
Defined in
append(elm, distElement?): this
Parameters
| Name | Type | 
|---|---|
elm | 
IUIElement | 
distElement? | 
string | 
Returns
this
Inherited from
Defined in
append(elm, distElement?): this
Parameters
| Name | Type | 
|---|---|
elm | 
IUIElement[] | 
distElement? | 
string | 
Returns
this
Inherited from
Defined in
afterSetMod
afterSetMod(name, value): void
Parameters
| Name | Type | 
|---|---|
name | 
string | 
value | 
ModType | 
Returns
void
Inherited from
Defined in
src/core/ui/group/group.ts#134
remove
remove(elm): this
Remove element from group
Parameters
| Name | Type | 
|---|---|
elm | 
IUIElement | 
Returns
this
Inherited from
Defined in
src/core/ui/group/group.ts#165
clear
clear(): this
Clear group
Returns
this
Inherited from
Defined in
src/core/ui/group/group.ts#180
getButtonsNames
getButtonsNames(): string[]
Helper for getting full plain button list
Returns
string[]
Inherited from
ToolbarCollection.getButtonsNames
Defined in
setRemoveButtons
setRemoveButtons(removeButtons?): this
Parameters
| Name | Type | 
|---|---|
removeButtons? | 
string[] | 
Returns
this
Inherited from
ToolbarCollection.setRemoveButtons
Defined in
update
update(): void
Update all children
Returns
void
Inherited from
Defined in
src/modules/toolbar/collection/collection.ts#101
setDirection
setDirection(direction): void
Set direction
Parameters
| Name | Type | 
|---|---|
direction | 
"rtl" | "ltr" | 
Returns
void
Inherited from
ToolbarCollection.setDirection
Defined in
src/modules/toolbar/collection/collection.ts#108
build
build(items, target?): this
Parameters
| Name | Type | Default value | 
|---|---|---|
items | 
ButtonsGroups | 
undefined | 
target | 
Nullable<HTMLElement> | 
null | 
Returns
this
Inherited from
Defined in
src/modules/toolbar/collection/collection.ts#137
destruct
destruct(): void
Returns
void
Inherited from
Defined in
src/modules/toolbar/collection/collection.ts#155
className
className(): string
Returns
string
Overrides
Defined in
src/modules/toolbar/collection/editor-collection.ts#28
shouldBeDisabled
shouldBeDisabled(button): boolean
Parameters
| Name | Type | 
|---|---|
button | 
IToolbarButton | 
Returns
boolean
Overrides
ToolbarCollection.shouldBeDisabled
Defined in
src/modules/toolbar/collection/editor-collection.ts#33
shouldBeActive
shouldBeActive(button): boolean
Parameters
| Name | Type | 
|---|---|
button | 
IToolbarButton | 
Returns
boolean
Overrides
ToolbarCollection.shouldBeActive
Defined in
src/modules/toolbar/collection/editor-collection.ts#49
getTarget
getTarget(button): null | Node
Parameters
| Name | Type | 
|---|---|
button | 
IToolbarButton | 
Returns
null | Node
Overrides
Defined in
src/modules/toolbar/collection/editor-collection.ts#144
showInline
showInline(bound?): void
Show the inline toolbar inside WYSIWYG editor.
Parameters
| Name | Type | Description | 
|---|---|---|
bound? | 
IBound | 
you can set the place for displaying the toolbar, or the place will be in the place of the cursor | 
Returns
void
Overrides
Defined in
src/modules/toolbar/collection/editor-collection.ts#175
hide
hide(): void
Returns
void
Overrides
Defined in
src/modules/toolbar/collection/editor-collection.ts#179
show
show(): void
Returns
void
Overrides
Defined in
jodit/src/modules/toolbar/collection/editor-collection.ts:185