#Mithril-Bootstrap-Modal A Mithril implementation of a Bootstrap 3 modal dialog.
##How to use
After you have included a copy of Mithril and a copy of Bootstrap CSS in your document, include mithril_modal.css
and mithril_modal.js
var myModal = new Modal();
var app = {
view: function () {
return m('div', [
m('.btn.btn-primary', {onclick: myModal.show.bind(myModal)}, 'Click to show modal'),
myModal.view({
header: function () {
return m('h4.modal-title', 'modal title goes here');
},
body: function () {
return m('p', 'modal body goes here');
},
footer: function () {
return m('a.btn.btn-default', {
onclick: myModal.hide.bind(myModal)
}, 'Close');
}
})
]);
}
};
m.mount(document.getElementById('view'), app);
##API
###Methods
Modal.prototype.show
: Displays the modal instance.Modal.prototype.hide
: Hides the modal instance.Modal.prototype.isVisible
: Returns true if modal is visible, else false.