forked from Shopify/draggable
-
Notifications
You must be signed in to change notification settings - Fork 0
/
DroppableEvent.js
63 lines (57 loc) · 1.23 KB
/
DroppableEvent.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
import AbstractEvent from 'shared/AbstractEvent';
/**
* Base droppable event
* @class DroppableEvent
* @module DroppableEvent
* @extends AbstractEvent
*/
export class DroppableEvent extends AbstractEvent {
static type = 'droppable';
/**
* Original drag event that triggered this droppable event
* @property dragEvent
* @type {DragEvent}
* @readonly
*/
get dragEvent() {
return this.data.dragEvent;
}
}
/**
* Droppable over event
* @class DroppableOverEvent
* @module DroppableOverEvent
* @extends DroppableEvent
*/
export class DroppableOverEvent extends DroppableEvent {
static type = 'droppable:over';
static cancelable = true;
/**
* The droppable element you are over
* @property droppable
* @type {HTMLElement}
* @readonly
*/
get droppable() {
return this.data.droppable;
}
}
/**
* Droppable out event
* @class DroppableOutEvent
* @module DroppableOutEvent
* @extends DroppableEvent
*/
export class DroppableOutEvent extends DroppableEvent {
static type = 'droppable:out';
static cancelable = true;
/**
* The droppable element you _were_ over
* @property droppable
* @type {HTMLElement}
* @readonly
*/
get droppable() {
return this.data.droppable;
}
}