Ticket #23120: 23120.6.diff
File 23120.6.diff, 2.3 KB (added by , 12 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
5030 5030 margin: 5px 5px 0; 5031 5031 } 5032 5032 5033 .spinner.error, 5034 .spinner.success { 5035 background-image: url(../images/spinner-icons.png); 5036 background-size: 32px 16px; 5037 opacity: 1; 5038 filter: alpha(opacity=100); 5039 } 5040 5041 .spinner.error { 5042 background-position: -16px 0; 5043 } 5044 5045 .spinner.success { 5046 background-position: 0 0; 5047 } 5048 5033 5049 .no-float { 5034 5050 float: none; 5035 5051 } … … 9509 9525 max-width: 400px; 9510 9526 width: auto; 9511 9527 } 9528 9529 .spinner.error, 9530 .spinner.success { 9531 background-image: url(../images/spinner-icons-2x.png); 9532 background-size: 64px 32px; 9533 } 9534 9535 .spinner.error { 9536 background-position: -32px 0; 9537 } 9538 9539 .spinner.success { 9540 background-position: 0 0; 9541 } 9512 9542 } 9513 9543 9514 9544 /**