Add event handler for checkbox changes to manage refresh button state
- Implemented a new event listener for checkboxes with class 'g-checkbox'. - The listener updates the state of the '.multi-refresh' button based on the checked status of the checkbox. - Ensured that the refresh button is enabled or disabled appropriately when checkboxes are checked or unchecked.
This commit is contained in:
@@ -457,6 +457,14 @@
|
||||
});
|
||||
});
|
||||
|
||||
$( 'input.g-checkbox' ).on( 'ifChanged', function( event ) {
|
||||
$( '.multi-refresh' ).removeClass( 'btn-disabled' );
|
||||
var refresh_button = $( this ).closest( 'tr' ).next( 'tr' ).find( '.advert-refresh' );
|
||||
if ( refresh_button.hasClass( 'btn-disabled' ) && event.target.checked ) {
|
||||
$( '.multi-refresh' ).addClass( 'btn-disabled' );
|
||||
}
|
||||
});
|
||||
|
||||
$( 'body' ).on( click_event, '.multi-refresh', function(e)
|
||||
{
|
||||
e.preventDefault();
|
||||
|
||||
Reference in New Issue
Block a user