allow transition between 2 custom modal uses

This commit is contained in:
Corban-Lee Jones 2024-10-24 18:19:57 +01:00
parent 83a0ef25fe
commit efe469d4f5

View File

@ -22,6 +22,12 @@ const arrayToHtmlList = (array, bold=false) => {
const createModal = async (options = {}) => {
let $modal = $("#customModal");
// If transitioning from one modal to another, wait for this one to close
if ($modal.is(':visible')) {
$modal.modal('hide');
await new Promise(resolve => $modal.one('hidden.bs.modal', resolve));
}
let defaults = {
title: "Modal Title",
texts: [