Skip to content
This repository has been archived by the owner on Feb 4, 2024. It is now read-only.

Commit

Permalink
anti actualiser
Browse files Browse the repository at this point in the history
  • Loading branch information
elouanjef committed Jan 31, 2024
1 parent 195b6ed commit 10f1625
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions templates/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -285,17 +285,29 @@ <h5 class="modal-title" id="selectRoleModalLabel">Sélectionner le rôle</h5>
}
}

function blockPageRefresh() {
window.addEventListener('beforeunload', function (e) {
e.preventDefault();
e.returnValue = '';
});
}


function showLoadingModal() {
$('#loadingModal').modal('show');
togglePageClicks(false);
blockPageRefresh();
}

function hideLoadingModal() {
$('#loadingModal').modal('hide');
togglePageClicks(true);
}

$('#loadingModal').on('hidden.bs.modal', function () {
window.removeEventListener('beforeunload', function () {});
});

function showAlertModal(title, message) {
var modalTitle = document.getElementById('alertModalLabel');
var modalMessage = document.getElementById('alertModalMessage');
Expand Down

0 comments on commit 10f1625

Please sign in to comment.