/*
* Loader v0.1 by @andystrobel
* Copyright 2015 HumHub
*
* Show loader
*/
//
// create closure
//
(function ($) {
//
// plugin definition
//
$.fn.loader = function (options) {
// build main options before element iteration
var opts = $.extend({}, $.fn.loader.defaults, options);
function buildModal(message) {
var _modal = '
' +
''
$('body').append(_modal);
$('#loaderModal').modal({
backdrop: 'static',
keyboard: false,
show: true
});
}
// iterate and reformat each matched element
return this.each(function () {
// save object in a variable
$this = $(this);
// unbind all previous event handler
$this.unbind();
$this.click(function () {
// build modal and add it to DOM
buildModal($this.data("message"));
})
});
};
//
// plugin defaults
//
$.fn.loader.defaults = {};
//
// end of closure
//
})(jQuery);