Expand all

ve.ui.PositionedTargetToolbar

Extends

Constructor

new ve.ui.PositionedTargetToolbar(target, [config]) #

UserInterface positioned target toolbar.

Parameters:

Name Type Attributes Description
target ve.init.Target
config Object optional

Configuration options

Properties:
Name Type Attributes Description
floatable boolean optional

Toolbar can float when scrolled off the page

Source:
UserInterface positioned target toolbar.

Methods

calculateOffset() #

Calculate the left and right offsets of the toolbar

Source:
Calculate the left and right offsets of the toolbar

destroy() #

Destroys toolbar, removing event handlers and DOM elements.

Call this whenever you are done using a toolbar.

Inherited from:
Source:
Destroys toolbar, removing event handlers and DOM elements.

detach() #

Detach toolbar from surface and all event listeners

Overrides:
Source:
Detach toolbar from surface and all event listeners

float() #

Float the toolbar.

getCommands() → {Array.<string>} #

Get a list of commands available to this toolbar's surface

Inherited from:
Source:

Returns:

Command names

Type
Array.<string>
Get a list of commands available to this toolbar's surface

getElementOffset() → {Object} #

Get toolbar element's offsets

Source:

Returns:

Toolbar element's offsets

Type
Object
Get toolbar element's offsets

getHeight() → {number} #

Get height of the toolbar while floating

Source:

Returns:

Height of the toolbar

Type
number
Get height of the toolbar while floating

getSurface() → {ve.ui.Surface|null} #

Gets the surface which the toolbar controls.

Returns null if the toolbar hasn't been set up yet.

Inherited from:
Source:

Returns:

Surface being controlled

Type
ve.ui.Surface | null
Gets the surface which the toolbar controls.

getTarget() → {ve.init.Target} #

Gets the target which the toolbar controls.

Inherited from:
Source:

Returns:

Target being controlled

Type
ve.init.Target
Gets the target which the toolbar controls.

getToolAccelerator() #

getTriggers(name) → {Array.<ve.ui.Trigger>|undefined} #

Get triggers for a specified name.

Parameters:

Name Type Description
name string

Trigger name

Inherited from:
Source:

Returns:

Triggers

Type
Array.<ve.ui.Trigger> | undefined
Get triggers for a specified name.

isFloatable() → {boolean} #

Check if the toolbar can float

Source:

Returns:

The toolbar can float

Type
boolean
Check if the toolbar can float

isFloating() → {boolean} #

Check if the toolbar is floating

Source:

Returns:

The toolbar is floating

Type
boolean
Check if the toolbar is floating

isToolAvailable() #

onContextChange() #

Handle context changes on the surface.

Inherited from:
Source:

Fires:

Handle context changes on the surface.

onInspectorOrDialogOpeningOrClosing(win, openingOrClosing, data) #

Handle windows opening or closing in the dialogs' or inspectors' window manager.

Parameters:

Name Type Description
win OO.ui.Window
openingOrClosing jQuery.Promise
data Object
Inherited from:
Source:
Handle windows opening or closing in the dialogs' or inspectors' window manager.

onToolbarDialogsOpeningOrClosing(win, openingOrClosing, data) #

Handle windows opening or closing in the toolbar window manager.

Parameters:

Name Type Description
win OO.ui.Window
openingOrClosing jQuery.Promise
data Object
Source:
Handle windows opening or closing in the toolbar window manager.

onViewportResize() #

Handle the visible part of the surface viewport change dimensions

Source:
Handle the visible part of the surface viewport change dimensions

onWindowResize() #

While toolbar floating is enabled, the toolbar will stick to the top of the screen unless it would be over or under the last visible branch node in the root of the document being edited, at which point it will stop just above it.

Source:

While toolbar floating is enabled, the toolbar will stick to the top of the screen unless it would be over or under the last visible branch node in the root of the document being edited, at which point it will stop just above it.

onWindowScroll() #

Handle window scroll events

Source:
Handle window scroll events

setup(groups, [surface]) #

Setup toolbar

Parameters:

Name Type Attributes Description
groups Object

List of tool group configurations

surface ve.ui.Surface optional

Surface to attach to

Overrides:
Source:

Fires:

Setup toolbar

unfloat() #

Reset the toolbar to it's default non-floating position.

Source:
Reset the toolbar to it's default non-floating position.

updateToolState() #

Update the state of the tools

Inherited from:
Source:

Fires:

Update the state of the tools

Events

resize() #

surfaceChange(oldSurface, newSurface) #

Parameters:

Name Type Description
oldSurface ve.ui.Surface | null

Old surface being controlled

newSurface ve.ui.Surface | null

New surface being controlled

Inherited from:
Source:

updateState(fragment, direction, activeDialogs) #

Parameters:

Name Type Description
fragment ve.dm.SurfaceFragment | null

Surface fragment. Null if no surface is active.

direction Object | null

Context direction with 'inline' & 'block' properties if a surface exists. Null if no surface is active.

activeDialogs Array.<string>

List of names of currently open dialogs.

Inherited from:
Source: