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

16 lines
448 B
JavaScript
Raw Normal View History

2017-03-30 17:00:35 +02:00
$(document).on('turbolinks:load', init_modal_commentaire);
2016-11-14 18:00:26 +01:00
2016-11-17 10:50:28 +01:00
function init_modal_commentaire() {
2017-04-04 16:15:33 +02:00
var modal = $("#modalCommentairesDossierParChamp");
var body = modal.find(".modal-body");
var originalBody = body.html();
2016-11-14 18:00:26 +01:00
2017-04-04 16:15:33 +02:00
modal.on("show.bs.modal", function (e) {
body.load(e.relatedTarget.getAttribute("data-href"));
});
2016-11-17 10:50:28 +01:00
2017-04-04 16:15:33 +02:00
$("#modalCommentairesDossierParChamp").on("hidden.bs.modal", function (e) {
body.html(originalBody);
});
}