release/0.1.2.046 #4

Merged
Ray merged 5 commits from release/0.1.2.046 into master 2023-08-21 18:15:43 +00:00
3 changed files with 32 additions and 9 deletions
Showing only changes of commit d9b41dab54 - Show all commits

View File

@ -47,7 +47,7 @@
<p><b>Example Three</b></p> <p><b>Example Three</b></p>
<p>Launch an empty modal then update its title, body, footer and size.</p> <p>Launch an empty modal then update its title, body, footer and size.</p>
<div class="alert alert-secondary"> <div class="alert alert-secondary">
BSDialog.ShowToast('abc123', 'My Modal Box 123', null, 'sm');<br /> BSDialog.Create('abc123', 'My Modal Box 123', null, 'sm');<br />
BSDialog.UpdateTitle('abc123', 'My Modal Box 567');<br /> BSDialog.UpdateTitle('abc123', 'My Modal Box 567');<br />
BSDialog.UpdateBody('abc123', 'Help, I\'m toast!');<br /> BSDialog.UpdateBody('abc123', 'Help, I\'m toast!');<br />
BSDialog.UpdateFooter('abc123', '');<br /> BSDialog.UpdateFooter('abc123', '');<br />
@ -63,13 +63,25 @@
<p><b>Example Four</b></p> <p><b>Example Four</b></p>
<p>Launch a multiple modals</p> <p>Launch a multiple modals</p>
<div class="alert alert-secondary"> <div class="alert alert-secondary">
BSDialog.ShowToast('abc123', 'My Modal Box 123', 'Help! I\'m toast.', 'sm');<br /> BSDialog.Create('abc123', 'My Modal Box 123', 'Help! I\'m toast.', 'sm');<br />
BSDialog.ShowToast('abc123456', 'My Modal Box 123.567', 'Help! I\'m a second toast.', 'md');<br /> BSDialog.Create('abc123456', 'My Modal Box 123.567', 'Help! I\'m a second toast.', 'md');<br />
</div> </div>
<p><button id="button4" type="button" class="btn btn-primary">Launch Modal</button></p> <p><button id="button4" type="button" class="btn btn-primary">Launch Modal</button></p>
</div> </div>
</div> </div>
<div class="row mb-3 border-bottom">
<div class="col-12">
<p><b>Example Six</b></p>
<p>Show a toast-style modal</p>
<div class="alert alert-secondary">
BSDialog.ShowToast('abc123', 'My Modal Box 123', 'Help! I\'m toast.', 'sm');<br />
</div>
<p><button id="button6" type="button" class="btn btn-primary">Launch Modal</button></p>
</div>
</div>
<div class="row mb-3 border-bottom"> <div class="row mb-3 border-bottom">
<div class="col-12"> <div class="col-12">
@ -109,7 +121,7 @@ $(document).ready(function(){
}); });
$("#button3").on('click', function(){ $("#button3").on('click', function(){
BSDialog.ShowToast('abc123', 'My Modal Box 123', null, 'sm'); BSDialog.Create('abc123', 'My Modal Box 123', null, 'sm');
BSDialog.UpdateTitle('abc123', 'My Modal Box 567'); BSDialog.UpdateTitle('abc123', 'My Modal Box 567');
BSDialog.UpdateBody('abc123', 'Help, I\'m toast!'); BSDialog.UpdateBody('abc123', 'Help, I\'m toast!');
BSDialog.UpdateFooter('abc123', ''); BSDialog.UpdateFooter('abc123', '');
@ -117,8 +129,12 @@ $(document).ready(function(){
}); });
$("#button4").on('click', function(){ $("#button4").on('click', function(){
BSDialog.Create('abc123', 'My Modal Box 123', 'Help! I\'m toast.', 'sm');
BSDialog.Create('abc123456', 'My Modal Box 123.567', 'Help! I\'m a second toast.', 'md');
});
$("#button6").on('click', function(){
BSDialog.ShowToast('abc123', 'My Modal Box 123', 'Help! I\'m toast.', 'sm'); BSDialog.ShowToast('abc123', 'My Modal Box 123', 'Help! I\'m toast.', 'sm');
BSDialog.ShowToast('abc123456', 'My Modal Box 123.567', 'Help! I\'m a second toast.', 'md');
}); });
$("#button5").on('click', async function(){ $("#button5").on('click', async function(){

View File

@ -133,11 +133,19 @@ var BSDialog = {
}; };
}, },
ShowToast: function (id, title, message, size) { ShowToast: function (id, title, message, size) {
this.Create(id, title, null, size); const a = this;
this.UpdateBody(id, message);
a.Create(id, title, null, size);
a.UpdateBody(id, message);
const modal = a.Find(id);
modal.Footer.forEach(function(e) {
e.parentNode.removeChild(e);
});
}, },
ShowPrompt: async function (options) { ShowPrompt: async function (options) {
let a = this; const a = this;
let id = "prompt" + Math.floor(Math.random() * 10000) + 1000; let id = "prompt" + Math.floor(Math.random() * 10000) + 1000;
const _options = Object.assign(a.DefaultPromptOptions, options); const _options = Object.assign(a.DefaultPromptOptions, options);

1
bsdialog4.min.js vendored

File diff suppressed because one or more lines are too long