2018-10-02 16:59:30 +02:00
|
|
|
/* globals $ */
|
|
|
|
|
2017-03-30 17:00:35 +02:00
|
|
|
$(document).on('turbolinks:load', modal_action);
|
2016-03-16 15:34:35 +01:00
|
|
|
|
|
|
|
function modal_action() {
|
2020-04-30 15:42:29 +02:00
|
|
|
$('#pj-modal').on('show.bs.modal', function (event) {
|
2018-10-02 16:59:30 +02:00
|
|
|
$('#pj-modal .modal-body .table .tr-content').hide();
|
2016-03-17 14:50:10 +01:00
|
|
|
|
2018-10-02 16:59:30 +02:00
|
|
|
var button = $(event.relatedTarget); // Button that triggered the modal
|
2017-04-04 16:15:33 +02:00
|
|
|
var modal_title = button.data('modal_title'); // Extract info from data-* attributes
|
|
|
|
var modal_index = button.data('modal_index'); // Extract info from data-* attributes
|
2016-03-16 15:34:35 +01:00
|
|
|
|
2018-10-02 16:59:30 +02:00
|
|
|
var modal = $(this);
|
2017-04-12 11:12:05 +02:00
|
|
|
modal.find('#pj-modal-title').html(modal_title);
|
2018-10-02 16:59:30 +02:00
|
|
|
$('#pj-modal .modal-body .table #' + modal_index).show();
|
|
|
|
});
|
2017-01-02 14:05:31 +01:00
|
|
|
}
|