1export default function showAllCaracteristics() { 2 const list = document.querySelector(".characteristics__list") 3 const button = document.querySelector(".characteristics-show-all") 4 5 if (!list || !button) return // ÐÑовеÑÑем налиÑие ÑлеменÑов 6 7 const listItem = list.querySelector(".characteristics__item") 8 const items = list.querySelectorAll(".characteristics__item") 9 10 // ÐÑли ÑлеменÑов 4 или менÑÑе â ÑкÑÑваем ÐºÐ½Ð¾Ð¿ÐºÑ 11 if (items.length <= 4) { 12 button.style.display = "none" 13 return 14 } 15 16 // ФÑнкÑÐ¸Ñ Ð´Ð»Ñ Ð²ÑÑиÑÐ»ÐµÐ½Ð¸Ñ Ð²ÑÑоÑÑ 4 ÑлеменÑов 17 const getCollapsedHeight = () => { 18 const computedStyle = window.getComputedStyle(list) 19 const gapValue = parseFloat(computedStyle.gap) || 0 20 return listItem.offsetHeight * 4 + gapValue * 3 21 } 22 23 // УÑÑанавливаем наÑалÑное ÑоÑÑоÑние 24 list.style.maxHeight = getCollapsedHeight() + "px" 25 list.classList.remove("active") 26 button.textContent = "ÐÑе Ñ Ð°ÑакÑеÑиÑÑики" 27 28 button.addEventListener("click", () => { 29 if (list.classList.contains("active")) { 30 // СкÑÑÑÑ ÑаÑÑÑ ÑпиÑка 31 list.style.maxHeight = getCollapsedHeight() + "px" 32 list.classList.remove("active") 33 button.textContent = "ÐÑе Ñ Ð°ÑакÑеÑиÑÑики" 34 } else { 35 // ÐоказаÑÑ Ð²ÐµÑÑ ÑпиÑок 36 list.classList.add("active") 37 list.style.maxHeight = list.scrollHeight + "px" 38 button.textContent = "СкÑÑÑÑ" 39 } 40 }) 41}
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.