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:
|
- 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
}
#
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
isDraggable() → {boolean}
#
Check the draggable state of this widget
- Source:
Returns:
Widget supports draggable operations
- Type
- boolean
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:
setDragItem(item)
#
Set a dragged item
Parameters:
Name | Type | Description |
---|---|---|
item |
OO.ui.mixin.DraggableElement | Dragged item |
- Source:
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:
unsetDragItem()
#
Unset the current dragged item
- Source:
updateIndexes()
#
Update the index properties of the items
- Source:
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:
draggable([draggable])
#
Draggable state of this widget has changed.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
draggable |
boolean |
optional |
Widget is draggable |
- Source:
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: