import Mirror from '@shopify/draggable/src/Draggable/Plugins/Mirror/Mirror.js'
Mirror
Extends:
Mirror plugin which controls the mirror positioning while dragging
Constructor Summary
Public Constructor | ||
public |
constructor(draggable: Draggable) Mirror constructor. |
Member Summary
Public Members | ||
public |
initialScrollOffset: {"x": *, "y": *} Initial scroll offset for touch devices because the mirror is positioned fixed |
|
public |
initialX: * |
|
public |
initialY: * |
|
public |
lastMirrorMovedClient: {"x": *, "y": *} |
|
public |
lastMovedX: * |
|
public |
lastMovedY: * |
|
public |
mirror: * |
|
public |
mirrorOffset: * |
|
public |
Mirror options |
|
public |
scrollOffset: {"x": *, "y": *} Scroll offset for touch devices because the mirror is positioned fixed |
Method Summary
Public Methods | ||
public |
[onDragMove](dragEvent: *) |
|
public |
[onDragStart](dragEvent: *) |
|
public |
[onDragStop](dragEvent: *) |
|
public |
|
|
public |
attach() Attaches plugins event listeners |
|
public |
detach() Detaches plugins event listeners |
|
public |
getOptions(): Object Returns options passed through draggable |
Private Methods | ||
private |
[getAppendableContainer](options: Object): HTMLElement Returns appendable container for mirror based on the appendTo option |
|
private |
[onMirrorCreated](mirrorEvent: MirrorCreatedEvent): Promise Mirror created handler |
|
private |
[onMirrorMove](mirrorEvent: MirrorMoveEvent): Promise | null Mirror move handler |
Public Constructors
Public Members
public initialScrollOffset: {"x": *, "y": *} source
Initial scroll offset for touch devices because the mirror is positioned fixed
public initialX: * source
public initialY: * source
public lastMirrorMovedClient: {"x": *, "y": *} source
public lastMovedX: * source
public lastMovedY: * source
public mirror: * source
public mirrorOffset: * source
Public Methods
public [onDragMove](dragEvent: *) source
Params:
Name | Type | Attribute | Description |
dragEvent | * |
public [onDragStart](dragEvent: *) source
Params:
Name | Type | Attribute | Description |
dragEvent | * |
public [onDragStop](dragEvent: *) source
Params:
Name | Type | Attribute | Description |
dragEvent | * |
public [onScroll]() source
Private Methods
private [getAppendableContainer](options: Object): HTMLElement source
Returns appendable container for mirror based on the appendTo option
Params:
Name | Type | Attribute | Description |
options | Object | ||
options.source | HTMLElement | Current source |
Return:
HTMLElement |
private [onMirrorCreated](mirrorEvent: MirrorCreatedEvent): Promise source
Mirror created handler
Params:
Name | Type | Attribute | Description |
mirrorEvent | MirrorCreatedEvent |
private [onMirrorMove](mirrorEvent: MirrorMoveEvent): Promise | null source
Mirror move handler
Params:
Name | Type | Attribute | Description |
mirrorEvent | MirrorMoveEvent |