new IWDraggable(container, parent)
Draggable interface.
Parameters:
Name | Type | Description |
---|---|---|
container |
HTMLDivElement | the dragging object |
parent |
HTMLDivElement | the logical parent object |
Methods
-
allowDraggingOutsideParent(isDraggingOutsideParentAllowed)
-
Enables or disables the dragging mode for elements out of the parent node. The default value is
false
.Parameters:
Name Type Description isDraggingOutsideParentAllowed
boolean true if this element can be dragged out of the parent node Returns:
- Type
- void
-
getContainer()
-
Returns the draggable object
Returns:
- Type
- HTMLDivElement
-
getDragButton()
-
Returns the drag button for this element.
Returns:
- Type
- number
-
getDraggableContainer()
-
Returns the draggable container for this element.
Returns:
- Type
- HTMLDivElement
-
getDraggingBounds()
-
Returns the dragging area.
Returns:
- Type
- IWSize
-
getOnMouseMoveContainer()
-
Returns the container which will be registered for
onmousemove
events.Returns:
the container on which theonmousemove
events are registered.- Type
- DOMElement
-
isDraggable()
-
Returns
true
if this element is draggable, otherwise the return value isfalse
.Returns:
true
if this element is draggable- Type
- boolean
-
isDraggingOutsideParentAllowed()
-
Returns true if this element can be dragged out of the parent node.
Returns:
true if this control can be dragged out of the parent node- Type
- boolean
-
setDragButton(button)
-
Sets the drag button for this element. If you want to drag the object with the left and right mouse button you must call the
setDragButton()
method with the parameterIWButton.LEFT + IWButton.RIGHT
.Parameters:
Name Type Description button
number the new drag button. The default drag button is IWButton.LEFT
.Returns:
- Type
- void
-
setDraggable(isDraggable)
-
Sets an flag to indicate whether this element is draggable or not.
Parameters:
Name Type Description isDraggable
boolean Returns:
- Type
- void
-
setDraggableContainer(draggableContainer)
-
Sets the draggable container for this element. The default value is the container returned by getContainer().
Parameters:
Name Type Description draggableContainer
HTMLDivElement the draggable container Returns:
- Type
- void
-
setDraggingBounds(bounds)
-
Sets the dragging area relative to the parent container.
Parameters:
Name Type Description bounds
IWSize the dragging area Returns:
- Type
- void
-
setOnMouseMoveContainer(container)
-
Sets the container which will be registered for
onmousemove
events. By default theonmousemove
events will be registered on thewindow.document
container.Parameters:
Name Type Description container
DOMElement Returns:
- Type
- void