github.com/navikt/knorten@v0.0.0-20240419132333-1333f46ed8b6/templates/event/script.tmpl (about) 1 {{ define "event/logs/script" }} 2 function toggleShowAll(event) { 3 const tableDivID = event.currentTarget.parentElement.getAttribute("id") 4 const tableDiv = document.getElementById(tableDivID) 5 for (let i = 2; i<tableDiv.children[0].children[1].children.length; i++) { 6 const tableRow = tableDiv.children[0].children[1].children[i] 7 if (tableRow.hasAttribute("hidden")) { 8 tableRow.removeAttribute("hidden") 9 } 10 else { 11 tableRow.setAttribute("hidden", "hidden") 12 } 13 } 14 15 if (tableDiv.children[1].textContent == "Vis mer") { 16 tableDiv.children[1].textContent = "Vis mindre" 17 } 18 else { 19 tableDiv.children[1].textContent = "Vis mer" 20 } 21 } 22 {{ end }}