Ticket #27620: 27620.2.patch
File 27620.2.patch, 1.2 KB (added by , 11 years ago) |
---|
-
src/wp-admin/js/customize-controls.js
195 195 panels; 196 196 197 197 this.uploader = { 198 // Feature detect browser drag and drop support 199 canDragAndDrop: function() { 200 // this comes directly from Modernizr: http://www.modernizr.com/ 201 var div = document.createElement('div'); 202 // IE has support for drag and drop since version 5, but doesn't support dropping files from desktop 203 return (('draggable' in div) || ('ondragstart' in div && 'ondrop' in div)) && (mOxie.Env.browser !== 'IE' || mOxie.Env.version > 9); 204 }, 198 205 init: function() { 199 206 var fallback, button; 200 207 201 if ( this. supports.dragdrop )208 if ( this.canDragAndDrop() ){ 202 209 return; 210 } 203 211 204 212 // Maintain references while wrapping the fallback button. 205 213 fallback = control.container.find( '.upload-fallback' ); 206 214 button = fallback.children().detach(); 207 215 216 this.dropzone.hide(); 208 217 this.browser.detach().empty().append( button ); 209 218 fallback.append( this.browser ).show(); 210 219 }