1 # eModal for Bootstrap [![Build Status](https://travis-ci.org/saribe/eModal.svg?branch=master)](https://travis-ci.org/saribe/eModal)
2 **eModal** is a Easy way to manage modal dialogs using bootstrap.
9 1. Link to eModal.js `<script src="//rawgit.com/saribe/eModal/master/dist/eModal.min.js"></script>`
10 2. use eModal to display a modal for alert, ajax, prompt, confirm or iframe
12 // Display an alert modal with default title (Attention)
13 eModal.alert('You shall not pass!');
16 // Display a confirm modal, with custom title.
17 eModal.confirm('Do you really want to pass?', 'Question from Gandalf')
18 .then(confirmCallback, optionalCancelCallback);
20 // Display a ajax modal, with a title
21 eModal.ajax('http://mydomail.com/page.html', 'Jobs - Form apply')
22 .then(ajaxOnLoadCallback);
24 // Display an prompt modal, with a title
25 eModal.prompt('What is the best song ever?', 'Fill the input')
27 // Display an modal whith iframe inside, with a title
28 eModal.iframe('http://saribe.github.io/toastr8/', 'Hot news')
30 // eModal default settings with your custom html loading template
31 eModal.setEModalOptions({
32 loadingHtml: '<span class="fa fa-circle-o-notch fa-spin fa-3x text-primary"></span><h4>Loading</h4>',
38 The callback argument for prompt, confirm, ajax and iframe, now are provided in then function.
42 .confirm(question, title, function(trueOrFalse) { trueOrFalse ? doTrue() : doFalse(); });
46 .confirm(question, title)
47 .then(doTrue, doFalse);
49 ## Demo and documentation
50 - Demo can be found at http://saribe.github.io/eModal
56 Under MIT license - http://www.opensource.org/licenses/mit-license.php