Class: Toolbar

Granite.author.ui. Toolbar

Represents a Toolbar that pops up when an Editable is selected via its Overlay, and allows to perform ToolbarActions on this Editable.


new Toolbar(config)

Creates a Toolbar object.
It is usually up to the current Layer to define its own Toolbar (and thus, its own ToolbarActions).

Parameters:
Name Type Description
config Object

The configuration object

Properties
Name Type Description
actions Object

The object containing the high-level Granite.author.ui.ToolbarActions on Editables.

Source:
ui/ui.Toolbar.js
See:

Methods


close()

Closes the Toolbar

Source:
ui/ui.Toolbar.js

destroy()

Destroys the Toolbar, unbind all events and associated UI elements

Source:
ui/ui.Toolbar.js

disable()

Disables the Toolbar (blocks possible user interaction with it)

Source:
ui/ui.Toolbar.js

enable()

Enables the Toolbar (allow user interaction with it)

Source:
ui/ui.Toolbar.js

open(editable)

Opens the Toolbar on the passed Editable; this will call first Granite.author.ui.Toolbar#render and then Granite.author.ui.Toolbar#position

Parameters:
Name Type Description
editable Granite.author.Editable

the source Editable

Source:
ui/ui.Toolbar.js

position(editable)

Position the Toolbar on the passed Editable

Parameters:
Name Type Description
editable Granite.author.Editable

the source Editable

Source:
ui/ui.Toolbar.js
Returns:
  • the current Toolbar
Type
Granite.author.ui.Toolbar

registerAction(name, action)

Adds a new global action (available for all Editables)

Parameters:
Name Type Description
name String

unique name for the action

action Granite.author.ui.ToolbarAction

describes the action to be added on the Toolbar

Source:
ui/ui.Toolbar.js

render(editable)

Renders the Toolbar and appends the buttons associated with the actions contained in the current configuration

Parameters:
Name Type Description
editable Granite.author.Editable

the source Editable

Source:
ui/ui.Toolbar.js
Returns:
  • the current Toolbar
Type
Granite.author.ui.Toolbar

reposition()

Repositions the Toolbar on its current underlying Editable (if existing)

Source:
ui/ui.Toolbar.js