-
Notifications
You must be signed in to change notification settings - Fork 0
/
DataTransferItemList.cljs
70 lines (49 loc) · 2.1 KB
/
DataTransferItemList.cljs
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
64
65
66
67
68
69
(ns web.drag.DataTransferItemList
"The DataTransferItemList object is a list of `web.drag.DataTransferItem`
representing items being dragged. During a drag operation, each
has a `dataTransfer` property and that property is a DataTransferItemList."
(:refer-clojure :exclude [remove]))
(defn add
"Method.
The DataTransferItemList.add() method creates a new `web.drag.DataTransferItem`
the specified data and adds it to the drag data list. The item
be a `web.files.File` or a `string` of a given type. If the item
successfully added to the list, the newly-created `web.drag.DataTransferItem`
is returned.
`DataTransferItem = DataTransferItemList.add(data, type);
DataTransferItem = DataTransferItemList.add(file);`
See also: `https://developer.mozilla.org/en-US/docs/Web/API/DataTransferItemList/add`"
[this & args]
(-> this .-add (.apply this (clj->js args))))
(defn remove
"Method.
`js.undefined`.
`DataTransferItemList.remove(index);`
See also: `https://developer.mozilla.org/en-US/docs/Web/API/DataTransferItemList/remove`"
[this index]
(-> this (.remove index)))
(defn clear
"Method.
The `web.drag.DataTransferItemList` method clear() removes all
objects from the drag data items list, leaving the list empty.
`DataTransferItemList.clear();`
See also: `https://developer.mozilla.org/en-US/docs/Web/API/DataTransferItemList/clear`"
[this ]
(-> this (.clear)))
(defn data-transfer-item
"Method.
The DataTransferItem() getter method implements support for accessing
in the `web.drag.DataTransferItemList` using array-style syntax
is DataTransferItem[index]).
`dataItem = DataTransferItem[index];`
See also: `https://developer.mozilla.org/en-US/docs/Web/API/DataTransferItemList/DataTransferItem`"
[this ]
(-> this (.DataTransferItem)))
(defn length
"Property.
The read-only length property of the `web.drag.DataTransferItemList`
returns the number of items currently in the drag item list.
`length = DataTransferItemList.length;`
See also: `https://developer.mozilla.org/en-US/docs/Web/API/DataTransferItemList/length`"
[this]
(-> this (.-length)))