1(function ($, Drupal, once) { 2 /** 3 * Module: Modal Page 4 * Class name: modal-page-style. 5 * Description: Function to stop the video in the iframe when the modal is closed. 6 */ 7 Drupal.behaviors.modalPageCloseIframe = { 8 attach(context) { 9 once("block-search-pro", ".modal-page-style", context).forEach( 10 (modal) => { 11 const stopVideoIframe = () => { 12 const iframe = modal.querySelector("iframe"); 13 if (iframe) { 14 const src = iframe.src; 15 iframe.src = ""; 16 iframe.src = src; 17 } 18 }; 19 new MutationObserver((muts) => 20 muts.forEach( 21 (m) => 22 m.attributeName === "class" && 23 !modal.classList.contains("show") && 24 stopVideoIframe() 25 ) 26 ).observe(modal, { attributes: true }); 27 if (!modal.classList.contains("show")) { 28 stopVideoIframe(); 29 } 30 } 31 ); 32 }, 33 }; 34})(jQuery, Drupal, once);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.