Added Confirmation to Close Ticket in Client Portal - Seperated cofirmation modal to a seperate JS file which is now included in the Client Portal

This commit is contained in:
johnnyq
2023-10-20 19:10:25 -04:00
parent fcfb162ec8
commit ba9442e6c3
5 changed files with 23 additions and 19 deletions

View File

@@ -105,20 +105,3 @@ clipboard.on('error', function(e) {
$(function () {
$('[data-toggle="popover"]').popover()
});
$(document).ready(function() {
$("a.confirm-link").click(function(e) {
e.preventDefault();
// Save the link reference to use after confirmation
var linkReference = this;
// Show the confirmation modal
$("#confirmationModal").modal('show');
// When the submission is confirmed via the modal
$("#confirmSubmitBtn").off('click').on('click', function() {
window.location.href = $(linkReference).attr('href');
});
});
});

16
js/confirm_modal.js Normal file
View File

@@ -0,0 +1,16 @@
$(document).ready(function() {
$("a.confirm-link").click(function(e) {
e.preventDefault();
// Save the link reference to use after confirmation
var linkReference = this;
// Show the confirmation modal
$("#confirmationModal").modal('show');
// When the submission is confirmed via the modal
$("#confirmSubmitBtn").off('click').on('click', function() {
window.location.href = $(linkReference).attr('href');
});
});
});