Ticket #23120: 23120.10.diff
File 23120.10.diff, 2.3 KB (added by , 11 years ago) |
---|
-
src/wp-admin/css/colors.css
964 964 box-shadow: 0 1px 1px rgba(0,0,0,0.04); 965 965 } 966 966 967 .widget { 968 position: relative; 969 border-left: 0 solid transparent; 970 transition: border-left 0.2s ease-in-out; 971 } 972 .widget:before { 973 opacity: 0; 974 display: block; 975 content: "\f147"; 976 transition: opacity 0.2s ease-in-out; 977 -webkit-font-smoothing: antialiased; 978 font: normal 32px/1 'dashicons'; 979 position: absolute; 980 top: 2px; 981 left: -40px; 982 line-height: 43px; 983 color: #fff; 984 } 985 986 .widget.saved { 987 border-left: 48px solid #84d24c; 988 } 989 .widget.saved:before { 990 opacity: 1; 991 } 992 993 .spinner.error { 994 opacity: 1; 995 filter: alpha( opacity=100 ); 996 background: url( '' ); 997 } 998 999 .spinner.error:before { 1000 font: normal 20px/1 'dashicons'; 1001 content: '\f335'; 1002 color: #a00; 1003 } 1004 967 1005 #post-status-info { 968 1006 border-top: none; 969 1007 } -
src/wp-admin/js/widgets.js
332 332 333 333 save : function( widget, del, animate, order ) { 334 334 var sidebarId = widget.closest('div.widgets-sortables').attr('id'), 335 data = widget.find('form').serialize(), a ;335 data = widget.find('form').serialize(), a, spinner; 336 336 337 widget = $(widget); 338 $('.spinner', widget).show(); 337 widget = $(widget); 338 spinner = $('.spinner', widget); 339 spinner.show(); 339 340 340 341 a = { 341 342 action: 'save-widget', … … 372 373 widget.remove(); 373 374 } 374 375 } else { 375 $('.spinner').hide();376 spinner.hide(); 376 377 if ( r && r.length > 2 ) { 377 378 $( 'div.widget-content', widget ).html(r); 378 379 wpWidgets.appendTitle( widget ); … … 381 382 if ( order ) { 382 383 wpWidgets.saveOrder(); 383 384 } 385 }) 386 .success( function() { 387 setTimeout( function() { 388 widget.find( '.widget-title' ).click(); 389 widget.addClass( 'saved' ); 390 setTimeout( function() { 391 widget.removeClass( 'saved' ); 392 }, 2500 ); 393 }, 100 ); 394 }) 395 .error( function() { 396 if ( spinner ) { 397 spinner.show().addClass( 'error' ).delay( 1000 ).fadeOut( 'fast', function() { 398 spinner.removeClass( 'error' ); 399 }); 400 } 384 401 }); 385 402 }, 386 403