1
2
3
4
5
6
7
8
9
10
11
12
13
14
15 from pyjamas import DOM
16 from pyjamas.ui import Event
17
18 DRAG_EVENTS = [ "dragstart", "drag", "dragend"]
19
21 etype = DOM.eventGetType(event)
22 if etype == "dragstart":
23 for listener in listeners:
24 listener.onDragStart(event)
25 return True
26 elif etype == "drag":
27 for listener in listeners:
28 listener.onDrag(event)
29 return True
30 elif etype == "dragend":
31 for listener in listeners:
32 listener.onDragEnd(event)
33 return True
34 return False
35
37
41
47
49 self._dragListeners.append(listener)
50
52 self._dragListeners.remove(listener)
53
55 """
56 Store data into the DataTransfer object and set the allowed effects.
57
58 Set data into the event's dataTransfer with a content-type and some
59 string data.
60
61 Some native dataTransfer objects will only set content-type of "Text"
62 and/or "URL".
63
64 allowedEffects is one of: 'none', 'copy', 'copyLink', 'copyMove',
65 'link', 'linkMove', 'move', or 'all'
66
67 an example::
68
69 dt = event.dataTransfer
70 dt.setData('text/plain','Hello, World!')
71 dt.allowedEffects = 'copyMove'
72 """
73 pass
74
76 """
77 this happens periodically while the drag is in progress.
78 use DOM.eventPreventDefault(event) to cancel drag operation
79 """
80 pass
81
83 """
84 This happens on the initiating widget after the dragging mouse
85 is released.
86 """
87 pass
88