Expand all

abstract OO.ui.mixin.DraggableGroupElement

Constructor

new OO.ui.mixin.DraggableGroupElement([config])abstract #

DraggableGroupElement is a mixin class used to create a group element to contain draggable elements, which are items that can be clicked and dragged by a mouse. The class is used with OO.ui.mixin.DraggableElement.

Parameters:

Name Type Attributes Description
config Object optional

Configuration options

Properties:
Name Type Attributes Default Description
items Array.<OO.ui.mixin.DraggableElement>
orientation string optional
'vertical'

Item orientation: 'horizontal' or 'vertical'. The orientation should match the layout of the items. Items displayed in a single row or in several rows should use horizontal orientation. The vertical orientation should only be used when the items are displayed in a single column.

draggable boolean optional
true

The items are draggable. This can change with #toggleDraggable

Mixes in:
Source:

DraggableGroupElement is a mixin class used to create a group element to contain draggable elements, which are items that can be clicked and dragged by a mouse.

Methods

getDragItem() → {OO.ui.mixin.DraggableElement|null} #

Get the item that is currently being dragged.

Source:

Returns:

The currently dragged item, or null if no item is being dragged

Type
OO.ui.mixin.DraggableElement | null
Get the item that is currently being dragged.

isDraggable() → {boolean} #

Check the draggable state of this widget

Source:

Returns:

Widget supports draggable operations

Type
boolean
Check the draggable state of this widget

reorder(item, newIndex) #

Reorder the items in the group

Parameters:

Name Type Description
item OO.ui.mixin.DraggableElement

Reordered item

newIndex number

New index

Source:
Reorder the items in the group

setDragItem(item) #

Set a dragged item

Parameters:

Name Type Description
item OO.ui.mixin.DraggableElement

Dragged item

Source:
Set a dragged item

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:

Fires:

Change the draggable state of this widget.

unsetDragItem() #

Unset the current dragged item

Source:
Unset the current dragged item

updateIndexes() #

Update the index properties of the items

Source:
Update the index properties of the items

Events

drag(item, [newIndex]) #

An item has been dragged to a new position, but not yet dropped.

Parameters:

Name Type Attributes Description
item OO.ui.mixin.DraggableElement

Dragged item

newIndex number optional

New index for the item

Source:
An item has been dragged to a new position, but not yet dropped.

draggable([draggable]) #

Draggable state of this widget has changed.

Parameters:

Name Type Attributes Description
draggable boolean optional

Widget is draggable

Source:
Draggable state of this widget has changed.

reorder(item, [newIndex]) #

An item has been dropped at a new position.

Parameters:

Name Type Attributes Description
item OO.ui.mixin.DraggableElement

Reordered item

newIndex number optional

New index for the item

Source:
An item has been dropped at a new position.