demarches-normaliennes/app/assets/javascripts/dossier_commentaires_modal.js

17 lines
507 B
JavaScript
Raw Normal View History

2016-11-17 10:50:28 +01:00
$(document).on('page:load', init_modal_commentaire);
$(document).ready(init_modal_commentaire);
2016-11-14 18:00:26 +01:00
2016-11-17 10:50:28 +01:00
function init_modal_commentaire() {
var modal = $("#modalCommentairesDossierParChamp");
var body = modal.find(".modal-body");
var originalBody = body.html();
2016-11-14 18:00:26 +01:00
2016-11-17 10:50:28 +01:00
modal.on("show.bs.modal", function (e) {
body.load(e.relatedTarget.getAttribute("data-href"));
});
$("#modalCommentairesDossierParChamp").on("hidden.bs.modal", function (e) {
body.html(originalBody);
});
}