Namespace: selection

Granite.author. selection

Selection module, that handles the selection of Granite.author.Editables based on the user interaction with the Granite.author.ui.Overlays.

Granite.author.overlayManager broadcasts Overlay interaction events which are processed here

This module broadcasts cq-interaction-* events when an Granite.author.Editable receives the focus

Interactions are configurable via the Granite.author.selection.bindEvents function

Source:
selection.js

Members


active

The currently active Granite.author.Editable

Source:
selection.js

buttonPressed

The group selection action button of the toolbar is pressed

Source:
selection.js

modifierPressed

The key combination CTRL/CMD has been pressed indicating the group selection is active

Source:
selection.js

selected

The list of selected Granite.author.Editables

Source:
selection.js

Methods


activate(editable)

Activates the given Granite.author.Editable (and its Granite.author.ui.Overlay)

Also set the Granite.author.ui.Overlay as being in active state

Parameters:
Name Type Description
editable Granite.author.Editable

The Granite.author.Editable for which to activate an overlay

Source:
selection.js

bindEvents( [config])

Binds the interaction event handlers (interaction with the overlays)

Parameters:
Name Type Argument Description
config InteractionConfig <optional>

The event handling configuration object

Source:
selection.js

deactivateCurrent()

Deactivates the current Granite.author.Editable and Granite.author.ui.Overlay

Also removes all references to that Granite.author.Editable

Source:
selection.js

deselect(editable)

Parameters:
Name Type Description
editable
Source:
selection.js

deselectAll()

Deselects all previously selected Granite.author.ui.Overlays and Granite.author.Editables

Source:
selection.js

getAllSelected()

Returns all the selected Granite.author.Editables

Source:
selection.js
Returns:
Type
Array.<Granite.author.Editable>

getCurrentActive()

Returns the currently active Granite.author.Editable

The active Granite.author.Editable is the one that has the focus (Probably also have the editable toolbar floating nearby)

Source:
selection.js
Returns:
Type
Granite.author.Editable

getPreviousSelected()

Gets the previously selected Granite.author.Editable

Source:
selection.js
Returns:
Type
Granite.author.Editable

isSingleSelection()

Is the current selection in single mode

By opposition with the multiple mode

Source:
selection.js
Returns:
Type
boolean

select(editable)

Parameters:
Name Type Description
editable Granite.author.Editable
Source:
selection.js

unbindEvents()

Unbinds the interaction event handlers

Source:
selection.js