Make WordPress Core

Changeset 24310


Ignore:
Timestamp:
05/22/2013 01:30:00 AM (12 years ago)
Author:
azaozz
Message:

Image post format UI:

  • When initializing wp.Uploader pass null for 'container' and 'browser'. Fixes a bug where another instance of the uploader was attached to <body>.
  • Destroy the uploader instance if drag/drop is not supported (IE8 & 9).

See #24291.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/js/post-formats.js

    r24289 r24310  
    6868
    6969    var uploader = {
     70        container: null,
     71        browser:   null,
    7072        dropzone:  $('.wp-format-media-holder[data-format=image]'),
    7173        success:   imageFormatUploadSuccess,
     
    7880    };
    7981    uploader = new wp.Uploader( uploader );
    80     uploader.uploader.bind( 'BeforeUpload', imageFormatUploadStart );
    81     uploader.uploader.bind( 'UploadProgress', imageFormatUploadProgress );
    82     uploader.uploader.bind( 'FilesAdded', imageFormatUploadFilesAdded );
     82
     83    if ( uploader.supports.dragdrop ) {
     84        uploader.uploader.bind( 'BeforeUpload', imageFormatUploadStart );
     85        uploader.uploader.bind( 'UploadProgress', imageFormatUploadProgress );
     86        uploader.uploader.bind( 'FilesAdded', imageFormatUploadFilesAdded );
     87    } else {
     88        uploader.uploader.destroy();
     89        uploader = null;
     90    }
    8391
    8492    function switchFormatClass( format ) {
Note: See TracChangeset for help on using the changeset viewer.