themes/bases/Campussuite2015/includes/calendarEventItemModalTrigger.html.twig line 1

Open in your IDE?
  1. <script>
  2.     (function (window, document, $, undefined) {
  3.         $(function () {
  4.             $('#{{ _htmlId }}').on('click', '.meta-event-attachment-link', function (e) {
  5.                 var $target = $(e.currentTarget);
  6.                 var p = $.ajax({
  7.                     url: $target.attr('data-ajax'),
  8.                 });
  9.                 p.done(function (resp) {
  10.                     $(resp)
  11.                         .appendTo($('body'))
  12.                         .modal({
  13.                             show: false
  14.                         })
  15.                         .on('show.bs.modal', function () {
  16.                             $(this).css('display', 'block');
  17.                             var $d = $(this).find('.modal-dialog'),
  18.                                 o = ($(window).height() - $d.height()) / 2,
  19.                                 bm = parseInt($d.css('marginBottom'), 10);
  20.                             o = Math.max(o, bm);
  21.                             $d.css('margin-top', o);
  22.                         })
  23.                         .on('hidden.bs.modal', function () {
  24.                             $(this).remove();
  25.                         })
  26.                         .modal('show');
  27.                 });
  28.                 e.preventDefault();
  29.             });
  30.         });
  31.     })(window, document, jQuery);
  32. </script>