Ticket #23120: 23120.9.diff
File 23120.9.diff, 2.3 KB (added by , 11 years ago) |
---|
-
src/wp-admin/css/wp-admin.css
5938 5938 margin: 2px 5px 0; 5939 5939 } 5940 5940 5941 .spinner.success, 5942 .spinner.error { 5943 opacity: 1; 5944 filter: alpha(opacity=100); 5945 background: url(''); 5946 } 5947 5948 .spinner.success:before { 5949 font: normal 20px/1 'dashicons'; 5950 content: '\f147'; 5951 color: #395f39; 5952 } 5953 5954 .spinner.error { 5955 font: normal 20px/1 'dashicons'; 5956 content: '\f335'; 5957 color: #5f3939; 5958 } 5959 5941 5960 .no-float { 5942 5961 float: none; 5943 5962 } -
src/wp-admin/js/widgets.js
313 313 action: 'widgets-order', 314 314 savewidgets: $('#_wpnonce_widgets').val(), 315 315 sidebars: [] 316 } ;316 }, spinner; 317 317 318 318 if ( sidebarId ) { 319 $( '#' + sidebarId ).find('.spinner:first').css('display', 'inline-block');319 spinner = $( '#' + sidebarId ).find('.spinner:first').css('display', 'inline-block'); 320 320 } 321 321 322 322 $('div.widgets-sortables').each( function() { … … 326 326 }); 327 327 328 328 $.post( ajaxurl, data, function() { 329 $('.spinner').hide(); 329 if ( spinner ) { 330 spinner.addClass( 'success' ).delay( 1000 ).fadeOut( 'fast', function() { 331 spinner.removeClass( 'success' ); 332 }); 333 } 334 }) 335 .error( function() { 336 if ( spinner ) { 337 spinner.addClass( 'error' ).delay( 1000 ).fadeOut( 'fast', function() { 338 spinner.removeClass( 'error' ); 339 }); 340 } 330 341 }); 331 342 }, 332 343 333 344 save : function( widget, del, animate, order ) { 334 345 var sidebarId = widget.closest('div.widgets-sortables').attr('id'), 335 data = widget.find('form').serialize(), a ;346 data = widget.find('form').serialize(), a, spinner; 336 347 337 widget = $(widget); 338 $('.spinner', widget).show(); 348 widget = $(widget); 349 spinner = $('.spinner', widget); 350 spinner.show(); 339 351 340 352 a = { 341 353 action: 'save-widget', … … 372 384 widget.remove(); 373 385 } 374 386 } else { 375 $('.spinner').hide(); 387 spinner.addClass('success').delay( 1000 ).fadeOut( 'fast', function() { 388 spinner.removeClass( 'success' ); 389 }); 376 390 if ( r && r.length > 2 ) { 377 391 $( 'div.widget-content', widget ).html(r); 378 392 wpWidgets.appendTitle( widget );