Class adf.DragElementAction
Extends
adf.Action.
Defined in: Action.js.
Constructor Attributes | Constructor Name and Description |
---|---|
adf.DragElementAction(docIn, dontMoveElement)
Extends adf.Action to handle user interaction with the mouse to click and drag an absolutely
positioned HTML element in order to change its position on a page.
|
Field Attributes | Field Name and Description |
---|---|
The cursor type of this Action
|
|
The name of this Action
|
- Fields borrowed from class adf.Action:
- graphicsZIndex, symbol
Method Attributes | Method Name and Description |
---|---|
activate(element, callBack, continuousCallBack)
This method activates the action and registers the required event listeners to drag
an HTML DOM element.
|
|
Deactivates the event listeners set by this action
|
- Methods borrowed from class adf.Action:
- reactivate
Class Detail
adf.DragElementAction(docIn, dontMoveElement)
Extends adf.Action to handle user interaction with the mouse to click and drag an absolutely
positioned HTML element in order to change its position on a page. Dragging an element
requires the user to press the mouse button, move the cursor, and release the mouse button.
- Parameters:
- {Boolean} docIn
- When true, allows the mouse to drag the element even when the cursor is outside of the element's bounds. When false, the mouse drag will end anytime the mouse position is oustide the element's bounds.
- {Boolean} dontMoveElement Optional, Default: false
- When true, this adf.Action will not actually reposition the element, it will only perform event handling on the element as if it were actually dragging the element. This mechanism is used when you would like to delegate the moving of the element to another entity. For example, adf.MapContinuousPan delegates to adf.Map#offsetView.
Field Detail
{String}
cursor
The cursor type of this Action
- Default Value:
- "move"
{String}
name
The name of this Action
- Default Value:
- "adf.DragElementAction"
Method Detail
activate(element, callBack, continuousCallBack)
This method activates the action and registers the required event listeners to drag
an HTML DOM element.
- Parameters:
- {HTMLElement} element
- The HTML DOM element to be dragged.
- {Function} callBack
- Callback function is called after element is dragged. The function is called with two Integers as parameters, representing the x and y offset of the current cursor position with respect to the position where the drag was initiated.
- {Function} continuousCallBack
- Continuous callback function is called as the element is being dragged. This function is called with two Integers as parameters, representing the x and y offset of the current cursor position with respect to the position where the drag was initiated.
deactivate()
Deactivates the event listeners set by this action