Ticket #22732: 22732.upload.3.diff
| File 22732.upload.3.diff, 2.3 KB (added by koopersmith, 6 months ago) |
|---|
-
wp-includes/js/media-views.js
2085 2085 } 2086 2086 }, 2087 2087 2088 dispose: function() { 2089 if ( this.disposing ) 2090 return media.View.prototype.dispose.apply( this, arguments ); 2091 2092 // Run remove on `dispose`, so we can be sure to refresh the 2093 // uploader with a view-less DOM. Track whether we're disposing 2094 // so we don't trigger an infinite loop. 2095 this.disposing = true; 2096 return this.remove(); 2097 }, 2098 2099 remove: function() { 2100 var result = media.View.prototype.remove.apply( this, arguments ); 2101 2102 _.defer( _.bind( this.refresh, this ) ); 2103 return result; 2104 }, 2105 2106 refresh: function() { 2107 var uploader = this.controller.uploader; 2108 2109 if ( uploader ) 2110 uploader.refresh(); 2111 }, 2112 2088 2113 ready: function() { 2089 2114 var $browser = this.options.$browser, 2090 2115 $placeholder; … … 2101 2126 $placeholder.replaceWith( $browser.show() ); 2102 2127 } 2103 2128 2129 this.refresh(); 2104 2130 return this; 2105 2131 } 2106 2132 }); -
wp-includes/js/plupload/wp-plupload.js
293 293 progress: function() {}, 294 294 complete: function() {}, 295 295 refresh: function() { 296 var node, enabled, container; 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 // Toggle all auto-created file containers. 311 this._container().toggle( enabled ); 312 } 313 296 314 this.uploader.refresh(); 315 }, 316 317 _container: function() { 318 var runtime = this.uploader.runtime; 319 320 if ( this._$container && this._$container.length ) 321 return this._$container; 322 323 if ( 'html4' === runtime ) 324 return $('[target="' + this.uploader.id + '_iframe"]'); 325 326 if ( 'html5' !== runtime || 'flash' !== runtime || 'silverlight' !== runtime ) 327 return $(); 328 329 this._$container = $('#' + this.uploader.id + '_' + runtime + '_container'); 330 return this._$container; 297 331 } 298 332 }); 299 333
