"use strict"; $("#modal-1").fireModal({body: 'Modal body text goes here.'}); $("#modal-2").fireModal({body: 'Modal body text goes here.', center: true}); let modal_3_body = '
Object to create a button on the modal.
';
modal_3_body += '[\n';
modal_3_body += ' {\n';
modal_3_body += " text: 'Login',\n";
modal_3_body += " submit: true,\n";
modal_3_body += " class: 'btn btn-primary btn-shadow',\n";
modal_3_body += " handler: function(modal) {\n";
modal_3_body += " alert('Hello, you clicked me!');\n"
modal_3_body += " }\n"
modal_3_body += ' }\n';
modal_3_body += ']';
modal_3_body += '
';
$("#modal-3").fireModal({
title: 'Modal with Buttons',
body: modal_3_body,
buttons: [
{
text: 'Click, me!',
class: 'btn btn-primary btn-shadow',
handler: function(modal) {
alert('Hello, you clicked me!');
}
}
]
});
$("#modal-4").fireModal({
footerClass: 'bg-whitesmoke',
body: 'Add the bg-whitesmoke
class to the footerClass
option.',
buttons: [
{
text: 'No Action!',
class: 'btn btn-primary btn-shadow',
handler: function(modal) {
}
}
]
});
$("#modal-5").fireModal({
title: 'Login',
body: $("#modal-login-part"),
footerClass: 'bg-whitesmoke',
autoFocus: false,
onFormSubmit: function(modal, e, form) {
// Form Data
let form_data = $(e.target).serialize();
console.log(form_data)
// DO AJAX HERE
let fake_ajax = setTimeout(function() {
form.stopProgress();
modal.find('.modal-body').prepend('Now you can see something on the left side of the footer.
', created: function(modal) { modal.find('.modal-footer').prepend(''); }, buttons: [ { text: 'No Action', submit: true, class: 'btn btn-primary btn-shadow', handler: function(modal) { } } ] }); $('.oh-my-modal').fireModal({ title: 'My Modal', body: 'This is cool plugin!' });