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:
|
Methods
calculateHeight()
#
Calculate the height of the toolbar and emit a resize event if it has changed.
Fires:
calculateOffset()
#
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:
detach()
#
Detach toolbar from surface and all event listeners
- Overrides:
- Source:
float()
#
Float the toolbar.
getCommands() → {Array.<string>}
#
Get a list of commands available to this toolbar's surface
Returns:
Command names
- Type
- Array.<string>
- Inherited from:
- Source:
getElementOffset() → {Object}
#
getHeight() → {number}
#
Get height of the toolbar while floating
Returns:
Height of the toolbar
- Type
- number
getSurface() → {ve.ui.Surface|null}
#
null}
#
Gets the surface which the toolbar controls.
Returns null if the toolbar hasn't been set up yet.
Returns:
Surface being controlled
- Type
-
ve.ui.Surface
|
null
- Inherited from:
- Source:
getTarget() → {ve.init.Target}
#
Gets the target which the toolbar controls.
Returns:
Target being controlled
- Type
- ve.init.Target
- Inherited from:
- Source:
getToolAccelerator()
#
- Inherited from:
- Source:
getTriggers(name) → {Array.<ve.ui.Trigger>|undefined}
#
undefined}
#
Get triggers for a specified name.
Parameters:
| Name | Type | Description |
|---|---|---|
name |
string | Trigger name |
Returns:
Triggers
- Type
-
Array.<ve.ui.Trigger>
|
undefined
- Inherited from:
- Source:
isFloatable() → {boolean}
#
Check if the toolbar can float
Returns:
The toolbar can float
- Type
- boolean
isFloating() → {boolean}
#
Check if the toolbar is floating
Returns:
The toolbar is floating
- Type
- boolean
isToolAvailable()
#
- Inherited from:
- Source:
onContextChange()
#
Handle context changes on the surface.
Fires:
- Inherited from:
- Source:
onFocusChange(event)
#
Handle focus change events on the toolbar.
Parameters:
| Name | Type | Description |
|---|---|---|
event |
jQuery.Event | Focus change event |
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:
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 |
onViewportResize()
#
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.
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
setNarrow()
#
- Inherited from:
- Source:
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 |
Fires:
- Overrides:
- Source:
unfloat()
#
Reset the toolbar to it's default non-floating state.
updateToolState()
#
Update the state of the tools
Fires:
- Inherited from:
- Source:
Events
resize()
#
- Inherited from:
- Source:
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: