demarches-normaliennes/app/assets/javascripts/dossier_commentaires_modal.js
2017-04-04 16:59:40 +02:00

15 lines
448 B
JavaScript

$(document).on('turbolinks:load', init_modal_commentaire);
function init_modal_commentaire() {
var modal = $("#modalCommentairesDossierParChamp");
var body = modal.find(".modal-body");
var originalBody = body.html();
modal.on("show.bs.modal", function (e) {
body.load(e.relatedTarget.getAttribute("data-href"));
});
$("#modalCommentairesDossierParChamp").on("hidden.bs.modal", function (e) {
body.html(originalBody);
});
}