diff --git a/wp-admin/js/post-formats.js b/wp-admin/js/post-formats.js index 305637f3c8..8e7ca2c79c 100644 --- a/wp-admin/js/post-formats.js +++ b/wp-admin/js/post-formats.js @@ -67,6 +67,8 @@ window.wp = window.wp || {}; } var uploader = { + container: null, + browser: null, dropzone: $('.wp-format-media-holder[data-format=image]'), success: imageFormatUploadSuccess, error: imageFormatUploadError, @@ -77,9 +79,15 @@ window.wp = window.wp || {}; params: {} }; uploader = new wp.Uploader( uploader ); - uploader.uploader.bind( 'BeforeUpload', imageFormatUploadStart ); - uploader.uploader.bind( 'UploadProgress', imageFormatUploadProgress ); - uploader.uploader.bind( 'FilesAdded', imageFormatUploadFilesAdded ); + + if ( uploader.supports.dragdrop ) { + uploader.uploader.bind( 'BeforeUpload', imageFormatUploadStart ); + uploader.uploader.bind( 'UploadProgress', imageFormatUploadProgress ); + uploader.uploader.bind( 'FilesAdded', imageFormatUploadFilesAdded ); + } else { + uploader.uploader.destroy(); + uploader = null; + } function switchFormatClass( format ) { formatField.val( format );