FEAT save button inactive when saving
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
f0781cd77d
commit
51fa4023c2
|
|
@ -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>
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user