1(function ($, Drupal, once) { 2 Drupal.behaviors.paragraphConfirmModal = { 3 attach(context) { 4 once( 5 'paragraphConfirmModalButtonActions', 6 '#paragraph-confirm-modal', 7 context 8 ).forEach(el => { 9 const confirmRequired = el.querySelector('#confirm-required'); 10 const confirmBtn = el.querySelector('#confirmBtn'); 11 12 if (confirmRequired) { 13 confirmRequired.addEventListener('change', () => { 14 // If the checkbox is checked, enable the confirm button. 15 confirmBtn.disabled = !confirmRequired.checked; 16 17 confirmBtn.classList.toggle( 18 'button_disabled', 19 !confirmRequired.checked 20 ); 21 confirmBtn.classList.toggle( 22 'button_primary', 23 confirmRequired.checked 24 ); 25 }); 26 } 27 el.querySelector('#cancelBtn').addEventListener('click', () => { 28 // Get the data-target attribute value and redirect to that URL 29 window.location.href = el 30 .querySelector('#cancelBtn') 31 .getAttribute('data-target'); 32 }); 33 34 confirmBtn.addEventListener('click', () => { 35 // Hide the confirmModal only if confirm-required is checked (when present) 36 if ( 37 !confirmRequired || 38 el.querySelector('#confirm-required').checked 39 ) { 40 el.style.display = 'none'; 41 } 42 }); 43 }); 44 } 45 }; 46})(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.