Ticket #27880: 27880.2.diff
File 27880.2.diff, 2.4 KB (added by , 10 years ago) |
---|
-
src/wp-includes/js/media-views.js
3270 3270 localDrag: false, 3271 3271 overContainer: false, 3272 3272 overDropzone: false, 3273 draggingFile: null, 3273 3274 3274 3275 initialize: function() { 3275 3276 var self = this; … … 3309 3310 return supports; 3310 3311 }, 3311 3312 3313 isDraggingFile: function( event ) { 3314 if ( this.draggingFile !== null ) { 3315 return this.draggingFile; 3316 } 3317 3318 if ( _.isUndefined( event.originalEvent ) || _.isUndefined( event.originalEvent.dataTransfer ) ) { 3319 return false; 3320 } 3321 3322 this.draggingFile = _.indexOf( event.originalEvent.dataTransfer.types, 'Files' ) > -1 && 3323 _.indexOf( event.originalEvent.dataTransfer.types, 'text/plain' ) === -1; 3324 3325 return this.draggingFile; 3326 }, 3327 3312 3328 refresh: function( e ) { 3313 3329 var dropzone_id; 3314 3330 for ( dropzone_id in this.dropzones ) { … … 3320 3336 $( e.target ).closest( '.uploader-editor' ).toggleClass( 'droppable', this.overDropzone ); 3321 3337 } 3322 3338 3339 if ( ! this.overContainer && ! this.overDropzone ) { 3340 this.draggingFile = null; 3341 } 3342 3323 3343 return this; 3324 3344 }, 3325 3345 … … 3383 3403 return this; 3384 3404 }, 3385 3405 3386 containerDragover: function( ) {3387 if ( this.localDrag ) {3406 containerDragover: function( event ) { 3407 if ( this.localDrag || ! this.isDraggingFile( event ) ) { 3388 3408 return; 3389 3409 } 3390 3410 … … 3399 3419 _.delay( _.bind( this.refresh, this ), 50 ); 3400 3420 }, 3401 3421 3402 dropzoneDragover: function( e ) {3403 if ( this.localDrag ) {3422 dropzoneDragover: function( event ) { 3423 if ( this.localDrag || ! this.isDraggingFile( event ) ) { 3404 3424 return; 3405 3425 } 3406 3426 3407 3427 this.overDropzone = true; 3408 this.refresh( e );3428 this.refresh( event ); 3409 3429 return false; 3410 3430 }, 3411 3431 -
src/wp-includes/js/tinymce/plugins/wordpress/plugin.js
317 317 dom.bind( doc, 'dragstart dragend dragover drop', function( event ) { 318 318 if ( typeof window.jQuery !== 'undefined' ) { 319 319 // Trigger the jQuery handlers. 320 window.jQuery( document ).trigger Handler( event.type);320 window.jQuery( document ).trigger( new window.jQuery.Event( event ) ); 321 321 } 322 322 }); 323 323 }