Ticket #23120: 23120.4.diff
File 23120.4.diff, 2.4 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
4625 4625 margin: 5px 5px 0; 4626 4626 } 4627 4627 4628 .spinner.error, 4629 .spinner.success { 4630 background-image: url(../images/spinner-icons.png); 4631 background-size: 32px 16px; 4632 opacity: 1; 4633 filter: alpha(opacity=100); 4634 } 4635 4636 .spinner.error { 4637 background-position: -16px 0; 4638 } 4639 4640 .spinner.success { 4641 background-position: 0 0; 4642 } 4643 4628 4644 .no-float { 4629 4645 float: none; 4630 4646 } … … 9173 9189 .customize-loading #customize-container { 9174 9190 background-image: url(../images/wpspin_light-2x.gif); 9175 9191 } 9192 9193 .spinner.error, 9194 .spinner.success { 9195 background-image: url(../images/spinner-icons-2x.png); 9196 background-size: 64px 32px; 9197 } 9198 9199 .spinner.error { 9200 background-position: -32px 0; 9201 } 9202 9203 .spinner.success { 9204 background-position: 0 0; 9205 } 9176 9206 } 9177 9207 9178 9208 /* =Localized CSS