Ticket #40966: 40966.3.diff
File 40966.3.diff, 1.9 KB (added by , 8 years ago) |
---|
-
src/wp-admin/js/updates.js
2004 2004 errorMessages = [], 2005 2005 type, action; 2006 2006 2007 if ( bulkAction == 'update-selected' ) { 2008 // Disable the apply button while working 2009 $bulkActionForm.find('input[type="submit"]').prop( 'disabled', true ); 2010 } 2011 2007 2012 // Determine which type of item we're dealing with. 2008 2013 switch ( pagenow ) { 2009 2014 case 'plugins': … … 2023 2028 if ( ! itemsSelected.length ) { 2024 2029 event.preventDefault(); 2025 2030 $( 'html, body' ).animate( { scrollTop: 0 } ); 2031 $bulkActionForm.find('input[type="submit"]').prop( 'disabled', false ); 2026 2032 2027 2033 return wp.updates.addAdminNotice( { 2028 2034 id: 'no-items-selected', … … 2029 2035 className: 'notice-error is-dismissible', 2030 2036 message: wp.updates.l10n.noItemsSelected 2031 2037 } ); 2038 2032 2039 } 2033 2040 2041 2042 2034 2043 // Determine the type of request we're dealing with. 2035 2044 switch ( bulkAction ) { 2036 2045 case 'update-selected': … … 2042 2051 event.preventDefault(); 2043 2052 return; 2044 2053 } 2045 2046 2054 action = bulkAction.replace( 'selected', type ); 2047 2055 break; 2048 2056 … … 2054 2062 2055 2063 event.preventDefault(); 2056 2064 2065 2057 2066 // Un-check the bulk checkboxes. 2058 2067 $bulkActionForm.find( '.manage-column [type="checkbox"]' ).prop( 'checked', false ); 2059 2068 … … 2123 2132 } 2124 2133 } ); 2125 2134 2135 2136 2126 2137 // Reset admin notice template after #bulk-action-notice was added. 2127 2138 $document.on( 'wp-updates-notice-added', function() { 2128 2139 wp.updates.adminNotice = wp.template( 'wp-updates-admin-notice' ); 2140 $bulkActionForm.find('input[type="submit"]').prop( 'disabled', false ); 2129 2141 } ); 2130 2142 2131 2143 // Check the queue, now that the event handlers have been added.