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~DraggableViewMixinA mixin that brings the possibility to observe dragging of the view element. The view has to implement the
DraggableViewinterface to use it:export class MyDraggableView extends DraggableViewMixin( View ) implements DraggableView { // ... }Copy codeCreating a class extending it attaches a set of mouse and touch listeners allowing to observe dragging of the view element:
mousedownandtouchstarton the view element - starting the dragging.mousemoveandtouchmoveon the document - updating the view coordinates.mouseupandtouchendon 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>