diff --git a/resources/js/src/database/routines.ts b/resources/js/src/database/routines.ts index c5b871f394..259912433f 100644 --- a/resources/js/src/database/routines.ts +++ b/resources/js/src/database/routines.ts @@ -812,20 +812,10 @@ const DatabaseRoutines = { return; } - var buttonOptions = { - [window.Messages.strGo]: { - text: window.Messages.strGo, - class: 'btn btn-primary', - }, - [window.Messages.strClose]: { - text: window.Messages.strClose, - class: 'btn btn-secondary', - }, - }; - // Define the function that is called when - // the user presses the "Go" button - // @ts-ignore - buttonOptions[window.Messages.strGo].click = function () { + const routinesExecuteModal = document.getElementById('routinesExecuteModal'); + const modal = window.bootstrap.Modal.getOrCreateInstance(routinesExecuteModal); + + const routinesExecuteButtonEventHandler = function () { /** * @var data Form data to be sent in the AJAX request */ @@ -839,75 +829,71 @@ const DatabaseRoutines = { // Routine executed successfully ajaxRemoveMessage($msg); slidingMessage(data.message); - $ajaxDialog.dialog('close'); + modal.hide(); } else { ajaxShowMessage(data.error, false); } }); }; - // @ts-ignore - buttonOptions[window.Messages.strClose].click = function () { - $(this).dialog('close'); - }; + routinesExecuteModal.addEventListener('hidden.bs.modal', function () { + routinesExecuteModal.querySelector('.modal-title').textContent = ''; + routinesExecuteModal.querySelector('.modal-body').innerHTML = ''; - /** - * Display the dialog to the user - */ - var $ajaxDialog = $('