diff --git a/bsdialog5.js b/bsdialog5.js index 15750f9..b639458 100644 --- a/bsdialog5.js +++ b/bsdialog5.js @@ -1,6 +1,6 @@ /** * BSDialog5 - * @version v0.2.0.055 (2023/11/12 1428) + * @version v0.2.1.005 (2023/11/14 2028) */ var BSDialog5 = { Default: function() { @@ -51,8 +51,11 @@ var BSDialog5 = { a.id = _options.ID; a.pfx = "bsdia5_"; - 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); + + (new bootstrap.Modal(document.getElementById(a.pfx + _options.ID), { + backdrop: _options.EasyClose + })).show(); if (_options.URL == null) { await a.Update({ ID: _options.ID, Body: _options.Message }); @@ -180,21 +183,7 @@ var BSDialog5 = { GetBody: function() { return document.getElementsByTagName("body")[0]; }, - addBackdrop: function () { - const a = this; - - // don't allow duplicates - if (a.GetBody().querySelectorAll(".modal-backdrop").length > 0) { - return; - } - - a.appendHtml(a.GetBody(), '
'); - - // lock background - a.GetBody().classList.add("modal-open"); - a.GetBody().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 @@ -204,7 +193,7 @@ var BSDialog5 = { } let html = ""; - html += '"+e.Message+"
"),s+='"+e.Message+"
"),s+='