1document.querySelectorAll('.breedingdata').forEach((table) => { 2 3 let tabClone = table.cloneNode(true) 4 tabClone.style.position = 'absolute'; 5 tabClone.style.visibility = 'hidden'; 6 tabClone.style.top = '-100000px'; 7 tabClone.style.left = '-100000px'; 8 tabClone.style.display = 'block'; 9 document.body.appendChild(tabClone) 10 let head = tabClone.querySelector('.breedingdata-item--header'); 11 table.style.setProperty('--list-height', (tabClone.clientHeight - head.offsetHeight) + 'px'); 12 tabClone.remove() 13 14 // table.querySelectorAll('.breedingdata-item:not(.breedingdata-item--header)').forEach((row) => { 15 // 16 // if( row.querySelector('.range') == null ) return; 17 // 18 // let range = row.querySelector('.range'), 19 // point = row.querySelector('.point'), 20 // value = parseInt(range.dataset.value), 21 // min = 76, 22 // max = 136, 23 // pos; 24 // 25 // if( value === 0 ) { 26 // point.remove(); 27 // return; 28 // } 29 // 30 // 31 // function calculatePosition(val) { 32 // if (val) { 33 // val = val - min; 34 // let koe = (max - min) / val; 35 // 36 // return (100 / koe); 37 // } 38 // return false; 39 // } 40 // 41 // pos = calculatePosition(value); 42 // 43 // if (pos) { 44 // point.style.left = `${pos}%`; 45 // } else { 46 // point.style.display = 'none'; 47 // } 48 // 49 // 50 // if (range.dataset.min && range.dataset.max) { 51 // let minMax = document.createElement('span'); 52 // minMax.classList.add('min_max'); 53 // let leftPos = calculatePosition(parseInt(range.dataset.min)), 54 // rightPos = calculatePosition(parseInt(range.dataset.max)); 55 // if (leftPos && rightPos) { 56 // minMax.style.left = `${leftPos}%`; 57 // minMax.style.right = `${100 - rightPos}%`; 58 // range.appendChild(minMax); 59 // } 60 // } 61 // 62 // }) 63}) 64 65 66document.querySelector('.frame-type-c3bulls_show .view-selector').addEventListener('change', (evt) => { 67 if (evt.target.value === 'list') { 68 document.querySelector('.breedingdata').classList.remove('breedingdata--grid'); 69 document.querySelector('.breedingdata').classList.add('breedingdata--list'); 70 } else { 71 document.querySelector('.breedingdata').classList.add('breedingdata--grid'); 72 document.querySelector('.breedingdata').classList.remove('breedingdata--list'); 73 } 74}) 75 76// if (window.matchMedia('(max-width: 767px)').matches) { 77// document.querySelector('.frame-type-c3bulls_show .view-selector select').value = 'grid'; 78// document.querySelector('.breedingdata').classList.toggle('breedingdata--grid'); 79// document.querySelector('.breedingdata').classList.toggle('breedingdata--list'); 80// }
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.