-
Notifications
You must be signed in to change notification settings - Fork 1
/
tablist
60 lines (58 loc) · 1.91 KB
/
tablist
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
56
57
58
59
60
<!-- TABLIST CONTENT -->
<div class="tablist-container">
<div class="tablist">
<div class="tablist__inner-wrap">
<div class="tablist__menu">
<nav class="tablist-nav">
<ul class="visible-links">
{% if include.id %}
{% assign tablist = page[include.id] %}
{% else %}
{% assign tablist = page.tablist %}
{% endif %}
{% for tab in tablist %}
<li class="tablist__menu-item">
<a
class="
{% if include.id %}
tablist-{{ include.id }}-id-tab
{% if tab == page[include.id].first %}active{% endif %}
{% else %}
tablist-id-tab
{% if tab == page.tablist.first %}active{% endif %}
{% endif %}
"
onClick="tablistClickHandle(
event,
'tablist{% if include.id %}-{{ include.id }}{% endif %}',
'{{ tab.title }}'
)"
>
{{tab.title}}
</a>
</li>
{%- endfor -%}
</ul>
</nav>
</div>
</div>
</div>
{% if include.id %}
{% for tab in page[include.id] %}
{% assign tablist_name = "tablist-" | append: include.id %}
{% assign display = "none" %}
{% if tab == page[include.id].first %}
{% assign display = "block" %}
{% endif %}
{% include tablist_content id=include.id tablist_name=tablist_name tab=tab display=display%}
{% endfor %}
{% else %}
{% for tab in page.tablist %}
{% assign display = "none" %}
{% if tab == page.tablist.first %}
{% assign display = "block" %}
{% endif %}
{% include tablist_content id=include.id tablist_name="tablist" tab=tab display=display %}
{% endfor %}
{% endif %}
</div>