From ae3411f99ee0bcca0cbd0f295145a4c09bb25ed0 Mon Sep 17 00:00:00 2001 From: Ray Date: Tue, 14 Nov 2023 17:50:38 +0000 Subject: [PATCH 1/2] Changed to BS modal methods for launching modal Removed individual change and toast support --- bsdialog4.js | 103 ++++++----------------------------------------- bsdialog4.min.js | 4 +- 2 files changed, 14 insertions(+), 93 deletions(-) diff --git a/bsdialog4.js b/bsdialog4.js index 318943e..c1e11bb 100644 --- a/bsdialog4.js +++ b/bsdialog4.js @@ -1,6 +1,6 @@ /** * BSDialog4 - * @version v0.1.4.031 (2023/11/03 22:42) + * @version v0.1.3.006 (2023/11/14 17:40) */ var BSDialog = { Show: async function (options) { @@ -11,8 +11,12 @@ var BSDialog = { a.pfx = "bsdia4_"; a.body = document.getElementsByTagName("body")[0]; - a.addBackdrop(); - a.addModal(_options.ID, _options.Title, _options.Size, _options.ShowFooter, _options.EasyClose, _options.Colour); + a.addModal(_options.ID, _options.Title, _options.Size, _options.ShowFooter, _options.Colour); + + $("#" + a.pfx + _options.ID).modal({ + backdrop: _options.EasyClose, + show: true + }); if (_options.URL == null) { await a.Update({ ID: _options.ID, Body: _options.Message }); @@ -179,29 +183,9 @@ var BSDialog = { BodyURL: null, Footer: null, Size: null - }, - ShowToast: { - ID: null, - Title: "", - Message: "", - Size: "md" } }, - addBackdrop: function () { - const a = this; - - // don't allow duplicates - if (a.body.querySelectorAll(".modal-backdrop").length > 0) { - return; - } - - a.appendHtml(a.body, ''); - - // lock background - a.body.classList.add("modal-open"); - a.body.style.overflow = "hidden"; - }, - addModal: function (id, title, size, showFooter, easyClose, closeColour) { + addModal: function (id, title, size, showFooter, closeColour) { const a = this; // don't allow duplicates @@ -211,7 +195,7 @@ var BSDialog = { } let html = ""; - html += '