Utility to load and fill the global #modal div

This commit is contained in:
2016-10-13 19:19:03 +02:00
parent f4af83e4fc
commit 9a6cc298dc

View File

@@ -48,5 +48,20 @@
el.className = $.trim(classes.join(" "));
});
return this;
}
$.fn.openModalUrl = function(title, url) {
this.on('click', function(e){
e.preventDefault();
$('#modal').modal();
$("#modal .modal-header span.title").html(title);
$("#modal .modal-body").load(url);
});
};
}(jQuery));
$('#modal').on('hidden.bs.modal', function () {
$("#modal .modal-body").html('');
});