mirror of
https://github.com/olivierlacan/keep-a-changelog.git
synced 2025-07-28 00:04:10 +02:00
Always show FAQ answers
This commit is contained in:
parent
84d7c7834a
commit
831becb73e
@ -5,30 +5,4 @@ document.addEventListener("DOMContentLoaded", function(){
|
|||||||
languageCode = event.currentTarget.selectedOptions[0].value
|
languageCode = event.currentTarget.selectedOptions[0].value
|
||||||
window.location.replace(origin + "/" + languageCode)
|
window.location.replace(origin + "/" + languageCode)
|
||||||
});
|
});
|
||||||
|
|
||||||
var faqHeaders = document.querySelectorAll('.frequently-asked-questions h4');
|
|
||||||
|
|
||||||
for (var i = 0; i < faqHeaders.length; ++i) {
|
|
||||||
header = faqHeaders[i]
|
|
||||||
header.addEventListener('click', toggleVisibility);
|
|
||||||
}
|
|
||||||
|
|
||||||
function toggleVisibility(event) {
|
|
||||||
element = event.target;
|
|
||||||
element.classList.toggle('is-visible')
|
|
||||||
|
|
||||||
lastParagraph = element.nextElementSibling;
|
|
||||||
paragraphs = [];
|
|
||||||
paragraphs.push(lastParagraph);
|
|
||||||
|
|
||||||
while (lastParagraph.nextElementSibling && lastParagraph.nextElementSibling.tagName == "P") {
|
|
||||||
lastParagraph = lastParagraph.nextElementSibling;
|
|
||||||
paragraphs.push(lastParagraph)
|
|
||||||
}
|
|
||||||
|
|
||||||
for (var i = 0; i < paragraphs.length; ++i) {
|
|
||||||
paragraph = paragraphs[i]
|
|
||||||
paragraph.classList.toggle('is-visible');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
|
@ -148,26 +148,9 @@ div.frequently-asked-questions
|
|||||||
border-bottom: 1px solid transparentize($color-bark, 0.8)
|
border-bottom: 1px solid transparentize($color-bark, 0.8)
|
||||||
padding: 0 1.1em 1.3em 0
|
padding: 0 1.1em 1.3em 0
|
||||||
|
|
||||||
&:after
|
|
||||||
content: "⌄"
|
|
||||||
text-align: right
|
|
||||||
float: right
|
|
||||||
font-size: 2.8em
|
|
||||||
line-height: 0.4
|
|
||||||
margin-right: -0.3em
|
|
||||||
width: 1em
|
|
||||||
text-align: center
|
|
||||||
|
|
||||||
|
|
||||||
&.is-visible:after
|
|
||||||
content: "-"
|
|
||||||
|
|
||||||
h4 ~ p
|
h4 ~ p
|
||||||
display: none
|
font-size: 1em
|
||||||
font-size: 0.9em
|
margin-left: 1em
|
||||||
|
|
||||||
h4 ~ p.is-visible
|
|
||||||
display: inherit
|
|
||||||
|
|
||||||
.footer
|
.footer
|
||||||
font-size: .6em
|
font-size: .6em
|
||||||
|
Loading…
x
Reference in New Issue
Block a user