templates/front/_modal_show.html.twig line 1

Open in your IDE?
  1. <div class="modal fade" tabindex="-1" aria-hidden="true" data-modal-form-target="modal" id="exampleModal">
  2.     <div class="modal-dialog ">
  3.         <div class="modal-content">
  4.             <div class="modal-header">
  5.                 <h5 class="modal-title" data-modal-form-target="modalTitle" id="my_modal_title"></h5>
  6.                 <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
  7.             </div>
  8.             <div id="my_modal_body" class="modal-body"
  9.                  data-modal-form-target="modalBody"
  10.                  data-action="submit->modal-form#submitForm"
  11.             >
  12.                 {{ modalContent | default('Loading...') }}
  13.                 <script type="text/javascript" >
  14.                     $('body').on('click', '.open-centered-popup', event => {
  15.                         event.preventDefault();
  16.                         const width = 400; // Specify the width of the pop-up window.
  17.                         const height = 600; // Specify the height of the pop-up window.
  18.                         const left = (window.innerWidth - width) / 2; // Calculate the left position to center the window.
  19.                         const top = (window.innerHeight - height) / 2; // Calculate the top position to center the window.
  20.                         const windowFeatures = `width=${width},height=${height},scrollbars=yes,resizable=yes,top=${top},left=${left}`;
  21.                         const url = $(this).data('url');
  22.                         console.log('url = ' + url);
  23.                         // Open the pop-up window.
  24.                         window.open(url, '_blank', windowFeatures);
  25.                     });
  26.                 </script>
  27.             </div>
  28.         </div>
  29.     </div>
  30. </div>