umodal()
$.umodal()
$.umodal('some text').show();
umodal('Some title', 'some text').show();
$.umodal().title('Assigned title').text('Assigned text').show();
Possible themes: default, info, primary, success, warning, danger
umodal('Info', 'This is info theme assigned by function param', 'info').show();
$.umodal('Success', 'This is success theme assigned by setter').theme('success').show();
$.umodal('some text')
.button('ok', function(){alert('pressed OK button')})
.button('cancel', {class:'btn btn-warning', click:function(){alert('pressed cancel button')}})
.show();
function customWindow() {
$.umodal()
.setHeader('<h1>Custom Header</h1>')
.setBody('<div><p>Custom body</p></div>')
.setFooter('<div class="text-center"><p>Custom footer</p><button type="button" data-dismiss="modal">Ok</button></div>')
.show();
}
Also, with function
.setContent('some content')
possible to set whole page
There is another way to set all parameters and elements. Everything can be added by passing an object into parameter
function setByObject() {
var object = {
title : 'Alert',
text : 'Would you like to open repository in new window?',
theme: 'primary',
buttons : {
Yes : {
class : 'btn btn-success',
click:function(){
window.open('https://github.com/Kapitoha/umodal', '_blank', 'location=yes,height=570,width=520,scrollbars=yes,status=yes');
}
},
No:''
}
}
$.umodal(object).show();
}