Reference Source
import Composer from 'flarum/components/Composer.js'
public class | source

Composer

Extends:

flarum/Component~Component → Composer

The Composer component displays the composer. It can be loaded with a content component with load and then its position/state can be altered with show, hide, close, minimize, fullScreen, and exitFullScreen.

Member Summary

Public Members
public
public

Whether or not the composer currently has focus.

public
public

computedHeight: Integer: *

Computed the composer's current height, based on the intended height, and the composer's current state.

public

handle: *

public

height: Integer

The composer's intended height, which can be modified by the user (by dragging the composer handle).

public

oldPosition: Composer.PositionEnum

The composer's previous position.

public

position: Composer.PositionEnum

The composer's current position.

Method Summary

Public Methods
public

clear()

Clear the composer's content component.

public

close()

Confirm with the user so they don't lose their content, then close the composer.

public

config(isInitialized: *, context: *)

public

configHandle(element: DOMElement, isInitialized: Boolean)

Add the necessary event handlers to the composer's handle so that it can be used to resize the composer.

public

Build an item list for the composer's controls.

public

Exit fullscreen mode.

public

Take the composer into fullscreen mode.

public

hide()

Close the composer.

public

init()

public

load(component: Component)

Load a content component into the composer.

public

Minimize the composer.

public

onmousemove(e: Event)

Resize the composer according to mouse movement.

public

Finish resizing the composer when the mouse is released.

public

Confirm with the user that they want to close the composer and lose their content.

public

show()

Show the composer.

public

update()

Update (and animate) the DOM to reflect the composer's current state.

public

Update the amount of padding-bottom on the body so that the page's content will still be visible above the composer when the page is scrolled right to the bottom.

public

Update the DOM to reflect the composer's current height. This involves setting the height of the composer's root element, and adjusting the height of any flexible elements inside the composer's body.

public

view(): *

Public Members

public $backdrop: * source

public active: Boolean source

Whether or not the composer currently has focus.

public component: * source

public computedHeight: Integer: * source

Computed the composer's current height, based on the intended height, and the composer's current state. This will be applied to the composer's content's DOM element.

Return:

Integer

public handle: * source

public height: Integer source

The composer's intended height, which can be modified by the user (by dragging the composer handle).

public oldPosition: Composer.PositionEnum source

The composer's previous position.

public position: Composer.PositionEnum source

The composer's current position.

Public Methods

public clear() source

Clear the composer's content component.

public close() source

Confirm with the user so they don't lose their content, then close the composer.

public config(isInitialized: *, context: *) source

Params:

NameTypeAttributeDescription
isInitialized *
context *

public configHandle(element: DOMElement, isInitialized: Boolean) source

Add the necessary event handlers to the composer's handle so that it can be used to resize the composer.

Params:

NameTypeAttributeDescription
element DOMElement
isInitialized Boolean

public controlItems(): ItemList source

Build an item list for the composer's controls.

Return:

ItemList

public exitFullScreen() source

Exit fullscreen mode.

public fullScreen() source

Take the composer into fullscreen mode. Has no effect if the composer is hidden.

public hide() source

Close the composer.

public init() source

public load(component: Component) source

Load a content component into the composer.

Params:

NameTypeAttributeDescription
component Component

public minimize() source

Minimize the composer. Has no effect if the composer is hidden.

public onmousemove(e: Event) source

Resize the composer according to mouse movement.

Params:

NameTypeAttributeDescription
e Event

public onmouseup() source

Finish resizing the composer when the mouse is released.

public preventExit(): Boolean source

Confirm with the user that they want to close the composer and lose their content.

Return:

Boolean

Whether or not the exit was cancelled.

public show() source

Show the composer.

public update() source

Update (and animate) the DOM to reflect the composer's current state.

public updateBodyPadding() source

Update the amount of padding-bottom on the body so that the page's content will still be visible above the composer when the page is scrolled right to the bottom.

public updateHeight() source

Update the DOM to reflect the composer's current height. This involves setting the height of the composer's root element, and adjusting the height of any flexible elements inside the composer's body.

public view(): * source

Return:

*