Ticket #22732: 22732.upload.2.diff
| File 22732.upload.2.diff, 1.9 KB (added by koopersmith, 6 months ago) |
|---|
-
wp-includes/js/media-views.js
2079 2079 } 2080 2080 }, 2081 2081 2082 dispose: function() { 2083 if ( this.disposing ) 2084 return media.View.prototype.dispose.apply( this, arguments ); 2085 2086 // Run remove on `dispose`, so we can be sure to refresh the 2087 // uploader with a view-less DOM. Track whether we're disposing 2088 // so we don't trigger an infinite loop. 2089 this.disposing = true; 2090 return this.remove(); 2091 }, 2092 2093 remove: function() { 2094 var result = media.View.prototype.remove.apply( this, arguments ); 2095 2096 _.defer( _.bind( this.refresh, this ) ); 2097 return result; 2098 }, 2099 2100 refresh: function() { 2101 var uploader = this.controller.uploader; 2102 2103 if ( uploader ) 2104 uploader.refresh(); 2105 }, 2106 2082 2107 ready: function() { 2083 2108 var $browser = this.options.$browser, 2084 2109 $placeholder; … … 2095 2120 $placeholder.replaceWith( $browser.show() ); 2096 2121 } 2097 2122 2123 this.refresh(); 2098 2124 return this; 2099 2125 } 2100 2126 }); -
wp-includes/js/plupload/wp-plupload.js
293 293 progress: function() {}, 294 294 complete: function() {}, 295 295 refresh: function() { 296 var node, enabled; 297 298 if ( this.browser ) { 299 node = this.browser[0]; 300 301 while ( node ) { 302 if ( node === document.body ) { 303 enabled = true; 304 break; 305 } 306 node = node.parentNode; 307 } 308 309 this.uploader.disableBrowse( ! enabled ); 310 // If HTML5 mode, toggle the auto-created file container. 311 $('#' + this.uploader.id + '_html5_container').toggle( enabled ); 312 } 313 296 314 this.uploader.refresh(); 297 315 } 298 316 });
