The dropController is the central point where the different drag and drop interactions are managed.
It contains the different "sub controllers"; and each of them is basically managing a different kind of drag and drop interaction. The main one is the "general" one which handles d&d over Granite.author.ui.Overlays
- Source:
- ui/ui.dropController.js
Members
-
<static> ns.ui.dropController.dropareawidget
-
Manages d&d of an Asset over the DropArea widget
- Source:
- ui/ui.dropController.dropareawidget.js
-
<static> ns.ui.dropController.file
-
Manages d&d of an external file over an Granite.author.ui.Overlay in the Editor
- Source:
- ui/ui.dropController.file.js
-
<static> ns.ui.dropController.general
-
Manages d&d of different origins (referred by the
data-typeattribute of the target entity; e.g., "Component", "Asset", "Editable") over an Granite.author.ui.Overlay in the Editor- Source:
- ui/ui.dropController.general.js
-
<static> ns.ui.dropController.inputwidget
-
Manages d&d of an Asset over a FileUpload widget
- Source:
- ui/ui.dropController.inputwidget.js
-
<static> ns.ui.dropController.rteinline
-
Manages d&d of an object over the RTE inline editor.
- Source:
- ui/ui.dropController.rteinline.js
-
<static> ns.ui.dropController.rtewidget
-
Manages d&d of an Asset over the RTE widget
- Source:
- ui/ui.dropController.rtewidget.js
-
<static> registry
-
Registry storage for the Drop Controllers (for d&d interactions on Overlays)
- Source:
- ui/ui.dropController.js
Methods
-
<static> deregister(name)
-
Unregister a Drop Controller by the given name
Parameters:
Name Type Description nameString The name of the Drop Controller to unregister
- Source:
- ui/ui.dropController.js
- See:
-
<static> disable( [config])
-
Disable different d&d capabilities (by default, the dropController should be enabled for all Layers)
Parameters:
Name Type Argument Description configobject <optional>
The optional config object to specify which parts to enable; if omitted, all parts are disabled
Properties
Name Type Argument Description generalboolean <optional>
Disable general d&d capabilities on Overlays
filewidgetboolean <optional>
Disable d&d on FileUpload widget
dropareawidgetboolean <optional>
Disable d&d on DropArea widget
fileboolean <optional>
Disable d&d from file system
- Source:
- ui/ui.dropController.js
-
<static> disableDropzone(type)
-
Removes the highlighting style from all the DOM Elements associated as a drop zone for the given type of asset/component
Parameters:
Name Type Description typestring Type such as
assetorcomponent- Source:
- ui/ui.dropController.js
-
<static> enable( [config])
-
Enables all d&d capabilities (by default, the dropController should be enabled for all Layers)
Parameters:
Name Type Argument Description configobject <optional>
The optional config object to specify which parts to enable; if omitted, all parts are enabled
Properties
Name Type Argument Description generalboolean <optional>
Enable general d&d capabilities on Overlays
filewidgetboolean <optional>
Enable d&d on FileUpload widget
dropareawidgetboolean <optional>
Enable d&d on DropArea widget
fileboolean <optional>
Enable d&d from file system
- Source:
- ui/ui.dropController.js
-
<static> enableDropzone(type)
-
Highlights all the DOM Elements associated as a drop zone for the given type of asset/component as enabling the drop action
Parameters:
Name Type Description typestring Type such as
assetorcomponent- Source:
- ui/ui.dropController.js
-
<static> get(name)
-
Returns the Drop Controller by the given name
Parameters:
Name Type Description nameString The name of the Drop Controller to return
- Source:
- ui/ui.dropController.js
Returns:
- Type
- Object
-
<static> getEventTargetEditable(event)
-
Returns the Editable associated with the given event target DOM element
Parameters:
Name Type Description event- Source:
- ui/ui.dropController.js
Returns:
-
<static> getInsertBehavior(element, clientY)
-
Returns the insert behaviour for the given HTML Element at the given y-axis of the mouse
Parameters:
Name Type Description elementHTMLElement Target html element
clientYnumber Coordinate on the y-axis of the mouse
- Source:
- ui/ui.dropController.js
Returns:
"before" or "after"
- Type
- string
-
<static> register(name, controller)
-
Registers a Drop Controller
The registered drop controller handlers will be called by the general dropController depending on thedata-typeattribute of the dragged entity.This could be used to allow d&d on new asset types for instance.
Parameters:
Name Type Description nameString The name of the Drop Controller
controllerGranite.author.ui.dropController~DropController The Drop Controller object
- Source:
- ui/ui.dropController.js
- See:
-
- Granite.author.ui.dropController.general
Type Definitions
-
DropController
-
Represents a drag and drop operation where the drag origin entity type is determined by the getTypeName method, and the drop target is an Overlay in the Editor
Type:
- Object
- Source:
- ui/ui.dropController.js
Properties:
Name Type Description getTypeNamefunction Returns the type name of the entity that will be dragged (the drag origin)
handleDragStartfunction Handles the drag start operation
handleDragEndfunction Handles the drag end operation
handleDragEnterfunction Handles the drag enter operation
handleDragLeavefunction Handles the drag leave operation
handleDragfunction Handles the drag operation
handleDragOverfunction Handles the drag over operation
handleDropfunction Handles the drop operation
isInsertAllowedfunction Indicates if the drop is allowed on the current hovered Editable