@@ -48,7 +48,8 @@ $.widget( "ui.droppable", {
48
48
deactivate : null ,
49
49
drop : null ,
50
50
out : null ,
51
- over : null
51
+ over : null ,
52
+ drag : null
52
53
} ,
53
54
_create : function ( ) {
54
55
@@ -161,6 +162,21 @@ $.widget( "ui.droppable", {
161
162
162
163
} ,
163
164
165
+ _drag : function ( event ) {
166
+
167
+ var draggable = $ . ui . ddmanager . current ;
168
+
169
+ // Bail if draggable and droppable are same element
170
+ if ( ! draggable || ( draggable . currentItem || draggable . element ) [ 0 ] === this . element [ 0 ] ) {
171
+ return ;
172
+ }
173
+
174
+ if ( this . accept . call ( this . element [ 0 ] , ( draggable . currentItem || draggable . element ) ) ) {
175
+ this . _trigger ( "drag" , event , this . ui ( draggable ) ) ;
176
+ }
177
+
178
+ } ,
179
+
164
180
_out : function ( event ) {
165
181
166
182
var draggable = $ . ui . ddmanager . current ;
@@ -328,6 +344,7 @@ $.ui.ddmanager = {
328
344
if ( ! this . options ) {
329
345
return ;
330
346
}
347
+
331
348
if ( ! this . options . disabled && this . visible && intersect ( draggable , this , this . options . tolerance , event ) ) {
332
349
dropped = this . _drop . call ( this , event ) || dropped ;
333
350
}
@@ -360,14 +377,18 @@ $.ui.ddmanager = {
360
377
// Run through all droppables and check their positions based on specific tolerance options
361
378
$ . each ( $ . ui . ddmanager . droppables [ draggable . options . scope ] || [ ] , function ( ) {
362
379
363
- if ( this . options . disabled || this . greedyChild || ! this . visible ) {
380
+ if ( ! this . options || this . options . disabled || this . greedyChild || ! this . visible ) {
364
381
return ;
365
382
}
366
383
367
384
var parentInstance , scope , parent ,
368
385
intersects = intersect ( draggable , this , this . options . tolerance , event ) ,
369
386
c = ! intersects && this . isover ? "isout" : ( intersects && ! this . isover ? "isover" : null ) ;
370
387
if ( ! c ) {
388
+ if ( intersects && this . isover ) {
389
+ this . _drag . call ( this , event ) ;
390
+ }
391
+
371
392
return ;
372
393
}
373
394
0 commit comments