Ticket #23120: 23120.12.diff
File 23120.12.diff, 2.5 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 973 .widget:before { 974 opacity: 0; 975 display: block; 976 content: "\f147"; 977 transition: opacity 0.2s ease-in-out; 978 -webkit-font-smoothing: antialiased; 979 font: normal 32px/1 'dashicons'; 980 position: absolute; 981 top: 2px; 982 left: -40px; 983 line-height: 43px; 984 color: #fff; 985 } 986 987 .widget.saved { 988 border-left: 48px solid #84d24c; 989 } 990 .widget.saved:before { 991 opacity: 1; 992 } 993 994 .widget.save-failed .spinner { 995 opacity: 1; 996 filter: alpha( opacity=100 ); 997 background: url( '' ); 998 background-color: #a00; 999 padding: 3px; 1000 } 1001 1002 .widget.save-failed .spinner:before { 1003 font: normal 20px/1 'dashicons'; 1004 content: '\f335'; 1005 color: #fff; 1006 } 1007 967 1008 #post-status-info { 968 1009 border-top: none; 969 1010 } -
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 .done( function() { // The widget save was successful, collapse the widget and alert the user 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 .fail( function() { // The widget save failed, alert the user 396 setTimeout( function() { 397 widget.addClass( 'save-failed' ); 398 spinner.show(); 399 setTimeout( function() { 400 widget.removeClass( 'save-failed' ); 401 spinner.hide(); 402 }, 2500 ); 403 }, 100 ); 384 404 }); 385 405 }, 386 406