$(document).ready(function () { $('.modal').on("hidden.bs.modal", function (e) { //fire on closing modal box if ($('.modal:visible').length) { // check whether parent modal is opend after child modal close $('body').addClass('modal-open'); // if open mean length is 1 then add a bootstrap css class to body of the page } }); }); function back() { window.history.back(); } function alerteAnnulation(message){ return confirm(message); } function isNumberKey(evt){ var charCode = (evt.which) ? evt.which : evt.keyCode if (charCode > 31 && (charCode < 48 || charCode > 57)) return false; return true; } function isDecimalKey(evt){ var charCode = (evt.which) ? evt.which : evt.keyCode var isDecimal = true; if (charCode > 31 && (charCode < 48 || charCode > 57)) { isDecimal = false; } if(charCode == 44 || charCode == 46) { isDecimal = true; } return isDecimal; } function setButtonVisibilityByCheckbox(idCheckBox, idButton){ var checker = document.getElementById(idCheckBox); var button = document.getElementById(idButton); if(checker.checked){ button.disabled = false; button.classList.remove("disabled"); var x = window.scrollX, y = window.scrollY; button.focus(); window.scrollTo(x, y); } else { button.disabled = true; button.classList.add("disabled"); } } function openModal(idModal){ let modalDiv = $('#'+idModal); modalDiv.modal('show'); } function closeModal(idModal){ let modalDiv = $('#'+idModal); modalDiv.modal('hide'); }