Skip to content
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

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

charan1973
Copy link

No description provided.

directorySection.classList.toggle("collapsed");
}
}
</script>
</body>

</html>
Copy link
Owner

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 {
Copy link
Owner

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) => {
Copy link
Owner

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) => {
Copy link
Owner

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;

Copy link
Owner

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">
Copy link
Owner

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants