FEAT save button inactive when saving
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Antoine M 2025-04-07 15:08:22 +02:00
parent f0781cd77d
commit 51fa4023c2

View File

@ -94,24 +94,20 @@ add_action('edit_form_after_title', function () {
</div>
<script>
jQuery(function($) {
$('#set-offline-status').on('click', function(e) {
$('#save-post-custom').on('click', function(e) {
e.preventDefault();
$('#post_status').val('offline');
$('#post-status-display').text('Hors ligne');
$('#publish').trigger('click');
});
const $button = $(this);
$('#set-online-status').on('click', function(e) {
e.preventDefault();
$('#post_status').val('publish');
$('#post-status-display').text('En ligne');
$('#publish').trigger('click');
});
// Désactiver le bouton
$button.prop('disabled', true);
$('#save-post-status').on('click', function(e) {
e.preventDefault();
// Déclencher la sauvegarde du post
// Déclencher la sauvegarde
$('#publish').trigger('click');
// Réactiver le bouton après un délai
setTimeout(function() {
$button.prop('disabled', false);
}, 2000);
});
});
</script>