1const modalControl = document.querySelectorAll(".modal-control"); 2modalControl.forEach(control => { 3 control.addEventListener('click', function() { 4 const direction = control.getAttribute('direction') 5 const currentModal = control.closest('.modal'); 6 const currentIdx = parseInt(currentModal.dataset.idx) 7 const currentBlockID = control.closest('.ra-block').getAttribute('id') 8 const modals = document.querySelectorAll(".modal") 9 //hide all modals 10 modals && modals.forEach(modalElement => hideShowModal(modalElement, 'hide')) 11 12 const nextModalToShow = direction === 'left' ? currentIdx - 1 : currentIdx + 1 13 14 //show the next one 15 const nextModalElement = document.querySelector(`#${currentBlockID} .modal[data-idx="${nextModalToShow}"]`) 16 hideShowModal(nextModalElement, 'show') 17 }); 18}); 19 20const imageWrappers = document.querySelectorAll(".gallery-image-wrapper"); 21 22imageWrappers.forEach(imageWrapper => { 23 imageWrapper.addEventListener('click', () => openPhotoGalleryModal(imageWrapper)); 24 imageWrapper.addEventListener('keydown', (event) => { 25 if (event.code === 'Space' || event.keyCode === 32) { 26 event.preventDefault(); 27 openPhotoGalleryModal(imageWrapper); 28 } 29 }); 30}); 31 32function openPhotoGalleryModal(imageWrapper) { 33 const blockID = imageWrapper.closest('.ra-block').getAttribute('id'); 34 const modalIdx = imageWrapper.dataset.idx; 35 const modals = document.querySelectorAll(".modal"); 36 const nextModalElement = document.querySelector(`#${blockID} .modal[data-idx="${modalIdx}"]`); 37 38 //hide all modals 39 modals && modals.forEach(modalElement => hideShowModal(modalElement, 'hide')); 40 //show only the next one 41 hideShowModal(nextModalElement, 'show'); 42} 43 44const hideShowModal = (modalElement, visibilityState = 'hide') => { 45 if(!modalElement) return false; 46 47 let modalInstance = bootstrap.Modal.getOrCreateInstance(modalElement) 48 if(visibilityState === 'show') { 49 modalInstance.show(); 50 } else { 51 modalInstance.hide(); 52 } 53}
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.