Drag.js:32Drag gesture
Options:
- button: the button type to use when starting to drag (MMO.inputs.BUT_LEFT| MMO.inputs.BUT_WHEEL| MMO.inputs.BUT_RIGHT)
- ghost: a selector or an HTMLElement that is used to show the user the changes
- docks: a selector or a list of HTMLElement that can served as dock for the element
- target: a selecor or an HTMLElement that is the target of the changes. Use input.node by default
- mode:
- none: only gesture.current is updated
- rotate: not implemented
- size: resize width and height
- resize: alias of size
- size-width: resize width
- size-left: resize width by the left
- size-height: resize height
- size-top: resize height by the top
- move-x: move left
- move-y: move top
- move: move left and top
- min: {x: .., width: ..}
- max: {x: .., height: ..}class MMO.inputs.Drag extends MMO.inputs.Gesture
Events called on the element with event.detail = this:
- drag-over: on a dock, when the element is beeing dragged over
- drag-over-start: on a dock, when the element enters the dock
- drag-over-stop: on a dock, when the element leaves the dock
Override: drive the drag state machine. Only the configured button counts, and the geometry is recomputed, clamped and pushed to the ghost on every move.
Write the pending position to a node's inline style. Only the axes that actually moved are touched, so an untouched one keeps whatever the stylesheet says.