-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathschedule.njk
55 lines (53 loc) · 1.57 KB
/
schedule.njk
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
---
layout: page.njk
title: Schedule
class: star-bg
---
<div class="schedule">
{% for date in schedule %}
<button id="{{ date.key }}-btn"
type="button"
aria-expanded="true"
onclick="toggleDisclosure(this.id);"
class="schedule-date"
aria-controls="{{ date.key }}-panel">
<h2 class="section-title">
<span>
<svg xmlns="\http://www.w3.org/2000/svg"" viewBox="0 0 80 80" focusable="false">
<path d="M70.3 13.8L40 66.3 9.7 13.8z"></path>
</svg>
</span>
{{ date.name }}
</h2>
</button>
<div id="{{ date.key }}-panel">
<ul class="date-agenda">
{% for item in date.schedule %}
<li class="date-agenda-item">
<span class="time">{{ item.time }}</span>
<span class="separator">:</span>
<span class="description">
<span>{{ item.description }}</span>
<span class="location">{{ item.location }}</span>
</span>
</li>
{% endfor %}
</ul>
</div>
{% endfor %}
</div>
<script>
function toggleDisclosure(btnID) {
// Get the button that triggered this
var theButton = document.getElementById(btnID);
// If the button is not expanded...
if (theButton.getAttribute("aria-expanded") == "false") {
// Now set the button to expanded
theButton.setAttribute("aria-expanded", "true");
// Otherwise button is not expanded...
} else {
// Now set the button to collapsed
theButton.setAttribute("aria-expanded", "false");
}
}
</script>