WordPress.org

Make WordPress Core

Changeset 37722


Ignore:
Timestamp:
06/16/2016 04:53:42 AM (4 years ago)
Author:
azaozz
Message:

Media: properly refresh the position of the Plupload shim so it moves over the Select Files button or off the screen. Fixes selecting files in MS Edge on the Media grid and Media -> Add New screens.

Fixes #37039.

Location:
trunk/src/wp-includes/js
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/js/media-grid.js

    r36681 r37722  
    775775        event.preventDefault();
    776776        this.trigger( 'toggle:upload:attachment' );
     777
     778        if ( this.uploader ) {
     779            this.uploader.refresh();
     780        }
    777781    },
    778782
  • trunk/src/wp-includes/js/media/views/frame/manage.js

    r33342 r37722  
    190190        event.preventDefault();
    191191        this.trigger( 'toggle:upload:attachment' );
     192
     193        if ( this.uploader ) {
     194            this.uploader.refresh();
     195        }
    192196    },
    193197
  • trunk/src/wp-includes/js/plupload/handlers.js

    r31690 r37722  
    431431            if ( up.features.dragdrop && ! $(document.body).hasClass('mobile') ) {
    432432                uploaddiv.addClass('drag-drop');
    433                 $('#drag-drop-area').bind('dragover.wp-uploader', function(){ // dragenter doesn't fire right :(
     433                $('#drag-drop-area').on('dragover.wp-uploader', function(){ // dragenter doesn't fire right :(
    434434                    uploaddiv.addClass('drag-over');
    435                 }).bind('dragleave.wp-uploader, drop.wp-uploader', function(){
     435                }).on('dragleave.wp-uploader, drop.wp-uploader', function(){
    436436                    uploaddiv.removeClass('drag-over');
    437437                });
    438438            } else {
    439439                uploaddiv.removeClass('drag-drop');
    440                 $('#drag-drop-area').unbind('.wp-uploader');
     440                $('#drag-drop-area').off('.wp-uploader');
    441441            }
    442442
     
    444444                $('.upload-flash-bypass').hide();
    445445            }
     446        });
     447
     448        uploader.bind( 'postinit', function( up ) {
     449            up.refresh();
    446450        });
    447451
  • trunk/src/wp-includes/js/plupload/wp-plupload.js

    r36709 r37722  
    181181        });
    182182
     183        this.uploader.bind( 'postinit', function( up ) {
     184            up.refresh();
     185            self.init();
     186        });
     187
    183188        this.uploader.init();
    184189
     
    312317        });
    313318
    314         this.uploader.bind( 'PostInit', function() {
    315             self.init();
    316         });
    317319    };
    318320
Note: See TracChangeset for help on using the changeset viewer.