-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Collapsible directories #2
base: master
Are you sure you want to change the base?
Conversation
directorySection.classList.toggle("collapsed"); | ||
} | ||
} | ||
</script> | ||
</body> | ||
|
||
</html> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Needs a newline at the end of the file
@@ -6,25 +6,80 @@ | |||
|
|||
<body> | |||
<style> | |||
.hide-element { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This class isn't being used anywhere from what I can see, can we remove this?
<script> | ||
const directories = document.getElementsByClassName("directory-header"); | ||
for (let i = 0; i < directories.length; i++) { | ||
directories[i].onclick = (e) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use addEventListener
instead of onclick =
directly.
<script> | ||
const directories = document.getElementsByClassName("directory-header"); | ||
for (let i = 0; i < directories.length; i++) { | ||
directories[i].onclick = (e) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since the function is stateless, can we define this only one instead of defining it once for every directory?
margin-top: 0.5em; | ||
margin-left: 3px; | ||
display: flex; | ||
align-items: center; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
superflous newline
<div style="margin-left: 1%;"> | ||
{{ template "singlepagesection" .Children }} | ||
</div> | ||
<div class="directory-tree collapsed"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@charan1973 can you also fix the indentation in this section please?
No description provided.