ui/bindings/draggableviewmixin
module
Interfaces
-
module:ui/bindings/draggableviewmixin~DraggableView
Type Definitions
-
module:ui/bindings/draggableviewmixin~DraggableViewDragEvent
Functions
-
DraggableViewMixin( view ) → Mixed<Base, DraggableView>
module:ui/bindings/draggableviewmixin~DraggableViewMixin
A mixin that brings the possibility to observe dragging of the view element. The view has to implement the
DraggableView
interface to use it:export class MyDraggableView extends DraggableViewMixin( View ) implements DraggableView { // ... }
Creating a class extending it attaches a set of mouse and touch listeners allowing to observe dragging of the view element:
mousedown
andtouchstart
on the view element - starting the dragging.mousemove
andtouchmove
on the document - updating the view coordinates.mouseup
andtouchend
on the document - stopping the dragging.
The mixin itself does not provide a visual feedback (that is, the dragged element does not change its position) - it is up to the developer to implement it.
Type parameters
Base : extends Constructor<View<HTMLElement>>
Parameters
view : Base
Returns
Mixed<Base, DraggableView>