Changeset 41814
- Timestamp:
- 10/10/2017 08:38:22 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/js/widgets.js
r41813 r41814 551 551 if ( animate ) { 552 552 order = 0; 553 widget.slideUp( 'fast', function(){554 $( this).remove();553 widget.slideUp( 'fast', function() { 554 $( this ).remove(); 555 555 wpWidgets.saveOrder(); 556 delete self.dirtyWidgets[ id ]; 556 557 }); 557 558 } else { 558 559 widget.remove(); 560 delete self.dirtyWidgets[ id ]; 559 561 560 562 if ( sidebarId === 'wp_inactive_widgets' ) { … … 591 593 592 594 removeInactiveWidgets : function() { 593 var $element = $( '.remove-inactive-widgets' ), a, data;595 var $element = $( '.remove-inactive-widgets' ), self = this, a, data; 594 596 595 597 $( '.spinner', $element ).addClass( 'is-active' ); … … 603 605 604 606 $.post( ajaxurl, data, function() { 605 $( '#wp_inactive_widgets .widget' ).remove(); 606 $( '#inactive-widgets-control-remove' ).prop( 'disabled' , true ); 607 $( '#wp_inactive_widgets .widget' ).each(function() { 608 var $widget = $( this ); 609 delete self.dirtyWidgets[ $widget.find( 'input.widget-id' ).val() ]; 610 $widget.remove(); 611 }); 612 $( '#inactive-widgets-control-remove' ).prop( 'disabled', true ); 607 613 $( '.spinner', $element ).removeClass( 'is-active' ); 608 614 } );
Note: See TracChangeset
for help on using the changeset viewer.