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:
2025-06-28 22:05:30 +02:00
parent 5662033efd
commit fcf8af71aa
5 changed files with 62 additions and 32 deletions

View File

@@ -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();