@@ -72,6 +72,8 @@ angular.module('dndLists', [])
72
72
* which is the primary way we communicate with the target element
73
73
*/
74
74
element . on ( 'dragstart' , function ( event ) {
75
+ event = event . originalEvent || event ;
76
+
75
77
// Serialize the data associated with this element. IE only supports the Text drag type
76
78
event . dataTransfer . setData ( "Text" , angular . toJson ( scope . $eval ( attr . dndDraggable ) ) ) ;
77
79
@@ -99,6 +101,8 @@ angular.module('dndLists', [])
99
101
* we will invoke the callbacks specified with the dnd-moved or dnd-copied attribute.
100
102
*/
101
103
element . on ( 'dragend' , function ( event ) {
104
+ event = event . originalEvent || event ;
105
+
102
106
// If the dropEffect is none it means that the drag action was aborted or
103
107
// that the browser does not support this field. In either case we use
104
108
// the fallback which was initialized to none
@@ -130,6 +134,8 @@ angular.module('dndLists', [])
130
134
* specified with the dnd-selected attribute.
131
135
*/
132
136
element . on ( 'click' , function ( event ) {
137
+ event = event . originalEvent || event ;
138
+
133
139
scope . $apply ( function ( ) {
134
140
$parse ( attr . dndSelected ) ( scope ) ;
135
141
} ) ;
@@ -183,6 +189,8 @@ angular.module('dndLists', [])
183
189
* is being dragged over our list, or over an child element.
184
190
*/
185
191
element . on ( 'dragover' , function ( event ) {
192
+ event = event . originalEvent || event ;
193
+
186
194
// Disallow drop if it comes from an external source or is not text.
187
195
// Usually we would use a custom drag type for this, but IE doesn't support that.
188
196
if ( ! dndDragTypeWorkaround . isDragging ) return true ;
@@ -258,6 +266,8 @@ angular.module('dndLists', [])
258
266
* one child element per array element.
259
267
*/
260
268
element . on ( 'drop' , function ( event ) {
269
+ event = event . originalEvent || event ;
270
+
261
271
// Unserialize the data that was serialized in dragstart. According to the HTML5 specs,
262
272
// the "Text" drag type will be converted to text/plain, but IE does not do that.
263
273
var transferredObject = JSON . parse ( event . dataTransfer . getData ( "Text" )
@@ -298,6 +308,8 @@ angular.module('dndLists', [])
298
308
* is still dragging over the list. If you know a better way of doing this, please tell me!
299
309
*/
300
310
element . on ( 'dragleave' , function ( event ) {
311
+ event = event . originalEvent || event ;
312
+
301
313
element . removeClass ( "dndDragover" ) ;
302
314
$timeout ( function ( ) {
303
315
if ( ! element . hasClass ( "dndDragover" ) ) {
0 commit comments