mirror of
https://github.com/itflow-org/itflow
synced 2026-08-05 23:27:17 +00:00
18 lines
687 B
JavaScript
18 lines
687 B
JavaScript
// Delegated on document rather than bound to the links present at page load, so
|
|
// that confirm-link also works on markup injected by an ajax modal
|
|
$(document).ready(function() {
|
|
$(document).off('click.itflowConfirm').on('click.itflowConfirm', 'a.confirm-link', 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');
|
|
});
|
|
});
|
|
}); |