Changeset 23079
- Timestamp:
- 12/05/2012 09:21:17 PM (13 years ago)
- File:
-
- 1 edited
-
trunk/wp-includes/js/plupload/wp-plupload.js (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/js/plupload/wp-plupload.js
r23053 r23079 294 294 complete: function() {}, 295 295 refresh: function() { 296 var node, enabled, container;296 var node, attached, container, id; 297 297 298 298 if ( this.browser ) { 299 299 node = this.browser[0]; 300 300 301 // Check if the browser node is in the DOM. 301 302 while ( node ) { 302 303 if ( node === document.body ) { 303 enabled = true;304 attached = true; 304 305 break; 305 306 } … … 307 308 } 308 309 309 this.uploader.disableBrowse( ! enabled ); 310 // Toggle all auto-created file containers. 311 this._container().toggle( enabled ); 310 // If the browser node is not attached to the DOM, use a 311 // temporary container to house it, as the browser button 312 // shims require the button to exist in the DOM at all times. 313 if ( ! attached ) { 314 id = 'wp-uploader-browser-' + this.uploader.id; 315 316 container = $( '#' + id ); 317 if ( ! container.length ) { 318 container = $('<div class="wp-uploader-browser" />', { 319 id: 'wp-uploader-browser-' + this.uploader.id, 320 css: { 321 position: 'fixed', 322 top: '-1000px', 323 left: '-1000px', 324 height: 0, 325 width: 0 326 } 327 }).appendTo('body'); 328 } 329 330 container.append( this.browser ); 331 } 312 332 } 313 333 314 334 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;331 335 } 332 336 });
Note: See TracChangeset
for help on using the changeset viewer.