]> scripts.mit.edu Git - autoinstalls/wordpress.git/blobdiff - wp-includes/js/plupload/wp-plupload.dev.js
WordPress 3.4.2
[autoinstalls/wordpress.git] / wp-includes / js / plupload / wp-plupload.dev.js
index 94a5b2532b31e2050ce96a8c5f15dac5176fd02a..36848b08f10a49beb201d311c657cdc8c1d750d2 100644 (file)
@@ -73,6 +73,10 @@ if ( typeof wp === 'undefined' )
                        this.plupload[ elements[ key ] ] = this[ key ].prop('id');
                }
 
+               // If the uploader has neither a browse button nor a dropzone, bail.
+               if ( ! ( this.browser && this.browser.length ) && ! ( this.dropzone && this.dropzone.length ) )
+                       return;
+
                this.uploader = new plupload.Uploader( this.plupload );
                delete this.plupload;
 
@@ -113,7 +117,13 @@ if ( typeof wp === 'undefined' )
                        });
                }( this.dropzone, this.supports.dragdrop ));
 
-               this.browser.on( 'mouseenter', this.refresh );
+               if ( this.browser ) {
+                       this.browser.on( 'mouseenter', this.refresh );
+               } else {
+                       this.uploader.disableBrowse( true );
+                       // If HTML5 mode, hide the auto-created file container.
+                       $('#' + this.uploader.id + '_html5_container').hide();
+               }
 
                this.uploader.bind( 'UploadProgress', this.progress );