Ticket #19845: 19845.7.diff
File 19845.7.diff, 1.5 KB (added by , 11 years ago) |
---|
-
src/wp-includes/js/media-views.js
3520 3520 return supports; 3521 3521 }, 3522 3522 3523 isDraggingFile: function( e ) { 3524 if ( _.isUndefined( e.originalEvent ) || _.isUndefined( e.originalEvent.dataTransfer ) ) 3525 return false; 3526 3527 return _.indexOf( event.dataTransfer.types, 'Files' ) > -1; 3528 }, 3529 3523 3530 refresh: function( e ) { 3524 3531 var dropzone_id; 3525 3532 for ( dropzone_id in this.dropzones ) { … … 3593 3600 return this; 3594 3601 }, 3595 3602 3596 containerDragover: function() { 3603 containerDragover: function( e ) { 3604 if ( ! this.isDraggingFile( e ) ) 3605 return; 3606 3597 3607 this.overContainer = true; 3598 this.refresh( );3608 this.refresh( e ); 3599 3609 }, 3600 3610 3601 containerDragleave: function() { 3611 containerDragleave: function( e ) { 3612 if ( ! this.isDraggingFile( e ) ) 3613 return; 3614 3602 3615 this.overContainer = false; 3603 3604 3616 // Throttle dragleave because it's called when bouncing from some elements to others. 3605 _.delay( _.bind( this.refresh, this ), 50 );3617 _.delay( _.bind( this.refresh, this, e ), 50 ); 3606 3618 }, 3607 3619 3608 3620 dropzoneDragover: function( e ) { 3621 if ( ! this.isDraggingFile( e ) ) 3622 return; 3623 3609 3624 this.overDropzone = true; 3610 3625 this.refresh( e ); 3611 3626 return false; 3612 3627 }, 3613 3628 3614 3629 dropzoneDragleave: function( e ) { 3630 if ( ! this.isDraggingFile( e ) ) 3631 return; 3632 3615 3633 this.overDropzone = false; 3616 3634 _.delay( _.bind( this.refresh, this, e ), 50 ); 3617 3635 }