Ticket #23120: 23120.5.diff
File 23120.5.diff, 2.4 KB (added by , 11 years ago) |
---|
-
wp-admin/js/widgets.js
175 175 }, 176 176 177 177 saveOrder : function(sb) { 178 var spinner; 179 178 180 if ( sb ) 179 $('#' + sb).closest('div.widgets-holder-wrap').find('.spinner').css('display', 'inline-block');181 spinner = $('#' + sb).closest('div.widgets-holder-wrap').find('.sidebar-name .spinner').css('display', 'inline-block'); 180 182 181 183 var a = { 182 184 action: 'widgets-order', … … 190 192 }); 191 193 192 194 $.post( ajaxurl, a, function() { 193 $('.spinner').hide(); 195 if ( spinner ) { 196 spinner.addClass('success').fadeOut('slow', function() { 197 $(this).removeClass('success'); 198 }); 199 } 200 }) 201 .error( function() { 202 if ( spinner ) { 203 spinner.addClass('error').fadeOut('slow', function() { 204 $(this).removeClass('error'); 205 }); 206 } 194 207 }); 195 208 196 209 this.resize(); … … 235 248 wpWidgets.resize(); 236 249 } 237 250 } else { 238 $('.spinner').hide(); 251 $('.spinner', widget).addClass('success').fadeOut('slow', function() { 252 $(this).removeClass('success'); 253 }); 254 239 255 if ( r && r.length > 2 ) { 240 256 $('div.widget-content', widget).html(r); 241 257 wpWidgets.appendTitle(widget); … … 244 260 } 245 261 if ( order ) 246 262 wpWidgets.saveOrder(); 263 }) 264 .error( function() { 265 $('.spinner', widget).addClass('error').fadeOut('slow', function() { 266 $(this).removeClass('error'); 267 }); 247 268 }); 248 269 }, 249 270 -
wp-admin/css/wp-admin.css
4986 4986 margin: 5px 5px 0; 4987 4987 } 4988 4988 4989 .spinner.error, 4990 .spinner.success { 4991 background-image: url(../images/spinner-icons.png); 4992 background-size: 32px 16px; 4993 opacity: 1; 4994 filter: alpha(opacity=100); 4995 } 4996 4997 .spinner.error { 4998 background-position: -16px 0; 4999 } 5000 5001 .spinner.success { 5002 background-position: 0 0; 5003 } 5004 4989 5005 .no-float { 4990 5006 float: none; 4991 5007 } … … 9577 9593 .customize-loading #customize-container { 9578 9594 background-image: url(../images/wpspin_light-2x.gif); 9579 9595 } 9596 9597 .spinner.error, 9598 .spinner.success { 9599 background-image: url(../images/spinner-icons-2x.png); 9600 background-size: 64px 32px; 9601 } 9602 9603 .spinner.error { 9604 background-position: -32px 0; 9605 } 9606 9607 .spinner.success { 9608 background-position: 0 0; 9609 } 9580 9610 } 9581 9611 9582 9612 /* =Localized CSS