Changeset 27464
- Timestamp:
- 03/08/2014 01:34:04 AM (11 years ago)
- Location:
- trunk/src
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/css/edit.css
r27403 r27464 613 613 } 614 614 615 .wp-fullscreen-wrap .uploader-editor { 616 background: rgba( 0, 86, 132, 0.9 ); 617 position: fixed; 618 z-index: 100050; /* above the editor toolbar */ 619 } 620 615 621 .uploader-editor-content { 616 622 border: 1px dashed #fff; … … 620 626 right: 10px; 621 627 bottom: 10px; 622 pointer-events: none;623 628 } 624 629 625 630 #poststuff .uploader-editor-content h3 { 626 margin: -0.5em 0 0;627 631 position: absolute; 628 632 top: 50%; … … 636 640 padding: 0; 637 641 display: none; 638 pointer-events: none;639 642 } 640 643 -
trunk/src/wp-includes/js/media-views.js
r27454 r27464 3424 3424 3425 3425 initialize: function() { 3426 this.initialized = false; 3427 3428 // Bail if UA does not support drag'n'drop or File API. 3429 if ( ! this.browserSupport() ) { 3430 return this; 3431 } 3432 3426 3433 this.$document = $(document); 3427 3434 this.dropzones = []; … … 3435 3442 this.$document.on( 'dragleave', _.bind( this.containerDragleave, this ) ); 3436 3443 3444 this.initialized = true; 3437 3445 return this; 3438 3446 }, 3439 3447 3440 refresh: function() { 3448 browserSupport: function() { 3449 var supports = false, div = document.createElement('div'); 3450 3451 supports = ( 'draggable' in div ) || ( 'ondragstart' in div && 'ondrop' in div ); 3452 supports = supports && !! ( window.File && window.FileList && window.FileReader ); 3453 return supports; 3454 }, 3455 3456 refresh: function( e ) { 3441 3457 var dropzone_id; 3442 3458 for ( dropzone_id in this.dropzones ) { … … 3444 3460 this.dropzones[ dropzone_id ].toggle( this.overContainer || this.overDropzone ); 3445 3461 } 3462 3463 if ( ! _.isUndefined( e ) ) { 3464 $( e.target ).closest( '.uploader-editor' ).toggleClass( 'droppable', this.overDropzone ); 3465 } 3466 3446 3467 return this; 3447 3468 }, 3448 3469 3449 3470 render: function() { 3471 if ( ! this.initialized ) { 3472 return this; 3473 } 3474 3450 3475 media.View.prototype.render.apply( this, arguments ); 3451 3476 $( '.wp-editor-wrap' ).each( _.bind( this.attach, this ) ); … … 3515 3540 3516 3541 dropzoneDragover: function( e ) { 3517 $( e.target ).addClass( 'droppable' );3518 3542 this.overDropzone = true; 3519 _.defer( _.bind( this.refresh, this ));3543 this.refresh( e ); 3520 3544 return false; 3521 3545 }, 3522 3546 3523 3547 dropzoneDragleave: function( e ) { 3524 $( e.target ).removeClass( 'droppable' );3525 3548 this.overDropzone = false; 3526 this.refresh();3549 _.delay( _.bind( this.refresh, this, e ), 50 ); 3527 3550 } 3528 3551 });
Note: See TracChangeset
for help on using the changeset viewer.