Make WordPress Core

Changeset 29917


Ignore:
Timestamp:
10/16/2014 05:53:15 AM (10 years ago)
Author:
wonderboymusic
Message:

In wp.Uploader, when uploader:ready is triggered, set ready to true on the instance. This allows media workflows to check for an existing uploaded instance when opening.

Without this check, workflows might wait for uploader:ready, which could already have been fired. This would result in an unresponsive editor dropzone.

Fixes #29689.

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

Legend:

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

    r29876 r29917  
    37253725
    37263726        drop: function( event ) {
    3727             var $wrap = null;
     3727            var $wrap = null, uploadView;
    37283728
    37293729            this.containerDragleave( event );
     
    37483748                    multiple: true
    37493749                });
    3750                 this.workflow.on( 'uploader:ready', this.addFiles, this );
     3750                uploadView = this.workflow.uploader;
     3751                if ( uploadView.uploader && uploadView.uploader.ready ) {
     3752                    this.addFiles.apply( this );
     3753                } else {
     3754                    this.workflow.on( 'uploader:ready', this.addFiles, this );
     3755                }
    37513756            } else {
    37523757                this.workflow.state().reset();
  • trunk/src/wp-includes/js/plupload/wp-plupload.js

    r29788 r29917  
    159159                }, 0 );
    160160            });
    161 
     161           
     162            self.ready = true;
    162163            $(self).trigger( 'uploader:ready' );
    163164        });
Note: See TracChangeset for help on using the changeset viewer.