abstract OO.ui.mixin.DraggableElement

Constructor

new OO.ui.mixin.DraggableElement(config)abstract #

DraggableElement is a mixin class used to create elements that can be clicked and dragged by a mouse to a new position within a group. This class must be used in conjunction with OO.ui.mixin.DraggableGroupElement, which provides a container for the draggable elements.

Parameters:

Name Type Attributes Description
config Object optional

Configuration options

Properties:
Name Type Attributes Default Description
$handle jQuery optional

The part of the element which can be used for dragging, defaults to the whole element

draggable boolean optional
true

The items are draggable. This can change with #toggleDraggable but the draggable state should be called from the DraggableGroupElement, which updates the whole group

Source:

DraggableElement is a mixin class used to create elements that can be clicked and dragged by a mouse to a new position within a group.

Properties

cancelButtonMouseDownEventsstatic #

Methods

isDraggable() → {boolean} #

Check the draggable state of this widget.

Source:

Returns:

Widget supports draggable operations

Type
boolean
Check the draggable state of this widget.

toggleDraggable(isDraggable) #

Change the draggable state of this widget. This allows users to temporarily halt the dragging operations.

Parameters:

Name Type Attributes Description
isDraggable boolean optional

Widget supports draggable operations, omit to toggle

Source:
Change the draggable state of this widget.

Events

dragend() #

A dragend event is emitted when the user drags an item and releases the mouse, thus terminating the drag operation.

Source:

A dragend event is emitted when the user drags an item and releases the mouse, thus terminating the drag operation.

dragstart(item) #

A dragstart event is emitted when the user clicks and begins dragging an item.

Parameters:

Name Type Description
item OO.ui.mixin.DraggableElement

The item the user has clicked and is dragging with the mouse.

Source:
A dragstart event is emitted when the user clicks and begins dragging an item.

drop() #

A drop event is emitted when the user drags an item and then releases the mouse button over a valid target.

Source:

A drop event is emitted when the user drags an item and then releases the mouse button over a valid target.