@ons/design-system 48.0.2 → 49.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -379,7 +379,7 @@ $button-shadow-size: 3px;
379
379
  transform: rotate(90deg);
380
380
  }
381
381
 
382
- @include mq(m) {
382
+ @include mq(l) {
383
383
  display: none;
384
384
  }
385
385
  }
@@ -393,4 +393,41 @@ $button-shadow-size: 3px;
393
393
  opacity: 0.4;
394
394
  }
395
395
  }
396
+
397
+ &--dropdown {
398
+ @extend .ons-btn--ghost;
399
+ @extend .ons-btn--mobile;
400
+
401
+ width: 100%;
402
+
403
+ .ons-btn__inner {
404
+ background: $color-branded-tint;
405
+ border: none;
406
+ border-radius: 0;
407
+ box-shadow: none;
408
+ color: $color-text-link;
409
+ display: block;
410
+ font-size: 1rem;
411
+ font-weight: normal;
412
+ padding: 0.6rem 1rem;
413
+ text-align: left;
414
+
415
+ .ons-svg-icon {
416
+ fill: $color-text-link;
417
+ float: right;
418
+ margin-top: 3px;
419
+ }
420
+ }
421
+
422
+ &:active,
423
+ &:active:focus {
424
+ .ons-btn__inner {
425
+ background: $color-branded-secondary;
426
+ color: $color-white;
427
+ .ons-svg-icon {
428
+ fill: $color-white;
429
+ }
430
+ }
431
+ }
432
+ }
396
433
  }
@@ -170,20 +170,41 @@
170
170
  display: block;
171
171
  }
172
172
 
173
- &__bottom {
174
- background: $color-header;
175
- margin-top: -0.03rem;
176
- }
173
+ &-service-nav {
174
+ display: inline-block;
177
175
 
178
- &-search {
179
- padding: 1rem;
176
+ &--mobile {
177
+ background: $color-branded-tint;
178
+ padding: 1rem;
179
+ width: 100%;
180
+ }
180
181
 
181
- @include mq(m) {
182
- bottom: 65px;
182
+ &__list {
183
+ list-style: none;
184
+ margin: 0;
183
185
  padding: 0;
184
- position: absolute;
185
- right: 1rem;
186
- width: 20rem;
186
+ }
187
+
188
+ &__item {
189
+ display: inline-block;
190
+ margin: 0 0 0 1rem;
191
+ &--mobile {
192
+ display: block;
193
+ margin: 0 0 0.5rem;
194
+ }
195
+ &:first-child {
196
+ margin-left: 0;
197
+ }
198
+ }
199
+
200
+ .ons-language-links {
201
+ border-top: 1px solid $color-branded;
202
+ margin: 1.5rem 0 0;
203
+ padding: 1rem 0 0;
204
+
205
+ &__item {
206
+ margin: 0 0 0.5rem;
207
+ }
187
208
  }
188
209
  }
189
210
  }
@@ -1,7 +1,7 @@
1
1
  {% macro onsHeader(params) %}
2
2
  {% from "components/button/_macro.njk" import onsButton %}
3
3
  {% from "components/icons/_macro.njk" import onsIcon %}
4
- {% from "components/autosuggest/_macro.njk" import onsAutosuggest %}
4
+ {% from "components/navigation/_macro.njk" import onsNavigation %}
5
5
 
6
6
  {% set title_tag = "h1" if params.tilteAsH1 else "div" %}
7
7
  {% set currentLanguageISOCode = "en" %}
@@ -82,12 +82,13 @@
82
82
  {% endif %}
83
83
  <div class="ons-grid__col ons-col-auto ons-u-d-no@{{ breakpoint }}">
84
84
  {{ onsButton({
85
- "text": params.serviceLinks.toggleServicesButton.text | default("Menu") ,
85
+ "text": params.serviceLinks.toggleServicesButton.text | default("Menu"),
86
86
  "classes": "ons-u-d-no ons-js-toggle-services",
87
+ "type": "button",
87
88
  "buttonStyle": "mobile",
88
89
  "variants": buttonVariant,
89
90
  "attributes": {
90
- "aria-label": params.serviceLinks.toggleServicesButton.ariaLabel | default("Toggle menu") ,
91
+ "aria-label": params.serviceLinks.toggleServicesButton.ariaLabel | default("Toggle menu"),
91
92
  "aria-controls": params.serviceLinks.id,
92
93
  "aria-haspopup": "true",
93
94
  "aria-expanded": "false"
@@ -144,7 +145,7 @@
144
145
  {% endif %}
145
146
  </div>
146
147
  {% if params.button is defined and params.button %}
147
- <div class="ons-grid__col ons-col-auto ons-u-flex-no-shrink ons-u-d-no@xxs@m">
148
+ <div class="ons-grid__col ons-col-auto ons-u-flex-no-shrink">
148
149
  {{ onsButton({
149
150
  "text": params.button.text,
150
151
  "classes": "ons-u-d-no@xxs@m",
@@ -157,9 +158,9 @@
157
158
  }) }}
158
159
  </div>
159
160
  {% endif %}
160
- {% if params.navigation is defined and params.navigation and params.navigation.toggleButton is defined and params.navigation.toggleButton or params.autosuggest is defined and params.autosuggest %}
161
- <div class="ons-grid__col ons-col-auto ons-u-flex-no-shrink ons-u-d-no@m">
162
- {% if params.autosuggest is defined and params.autosuggest and isPatternLib is defined and isPatternLib %}
161
+ {% if params.navigation is defined %}
162
+ <div class="ons-grid__col ons-col-auto ons-u-flex-no-shrink ons-u-d-no@l">
163
+ {% if isPatternLib and params.navigation.siteSearchAutosuggest %}
163
164
  <span class="ons-grid ons-u-d-no@xxs@xs">
164
165
  {{ onsButton({
165
166
  "text": "Search",
@@ -168,22 +169,22 @@
168
169
  "iconType": "search",
169
170
  "iconPosition": "only",
170
171
  "attributes": {
171
- "aria-label": params.searchToggle.ariaLabel | default("Toggle search") ,
172
- "aria-controls": params.navigation.id,
172
+ "aria-label": "Toggle search" ,
173
+ "aria-controls": "ons-site-search",
173
174
  "aria-haspopup": "true",
174
175
  "aria-expanded": "false"
175
176
  }
176
177
  }) }}
177
178
  </span>
178
179
  {% endif %}
179
- {% if params.navigation.toggleButton is defined and params.navigation.toggleButton %}
180
+ {% if params.navigation.toggleNavigationButton is defined and params.navigation.toggleNavigationButton %}
180
181
  {{ onsButton({
181
- "text": params.navigation.toggleButton.text | default("Menu"),
182
- "classes": "ons-u-ml-xs ons-u-d-no ons-js-toggle-main",
182
+ "text": params.navigation.toggleNavigationButton.text,
183
+ "classes": "ons-u-ml-xs ons-u-d-no ons-js-navigation-button",
183
184
  "buttonStyle": "mobile",
184
185
  "variants": ["mobile", "ghost"],
185
186
  "attributes": {
186
- "aria-label": params.navigation.toggleButton.ariaLabel | default("Toggle menu") ,
187
+ "aria-label": params.navigation.toggleNavigationButton.ariaLabel | default("Toggle main menu") ,
187
188
  "aria-controls": params.navigation.id,
188
189
  "aria-haspopup": "true",
189
190
  "aria-expanded": "false"
@@ -196,47 +197,7 @@
196
197
  </div>
197
198
  </div>
198
199
  {% if params.navigation is defined and params.navigation %}
199
- <div class="ons-header__bottom">
200
- <div class="ons-container ons-container--gutterless@xxs@m{{ ' ons-container--full-width' if params.fullWidth }}{{ ' ons-container--wide' if params.wide }}">
201
- {% if params.autosuggest is defined and params.autosuggest and isPatternLib is defined and isPatternLib %}
202
- <div class="ons-header-search ons-js-header-search">
203
- {{ onsAutosuggest({
204
- "id": "ons-autosuggest-header-search",
205
- "containerClasses": "ons-autosuggest-input--header",
206
- "classes": "ons-input--ghost ons-input-search ons-input-search--icon",
207
- "label": {
208
- "text": params.autosuggest.label,
209
- "id": "ons-autosuggest-header-search-label",
210
- "classes": "ons-label--white ons-u-pl-m"
211
- },
212
- "accessiblePlaceholder": true,
213
- "autocomplete": "off",
214
- "instructions": params.autosuggest.instructions,
215
- "ariaYouHaveSelected":params.autosuggest.ariaYouHaveSelected,
216
- "ariaMinChars": params.autosuggest.ariaMinChars,
217
- "ariaResultsLabel": params.autosuggest.ariaResultsLabel,
218
- "ariaOneResult": params.autosuggest.ariaOneResult,
219
- "ariaNResults": params.autosuggest.ariaNResults,
220
- "ariaLimitedResults": params.autosuggest.ariaLimitedResults,
221
- "moreResults": params.autosuggest.moreResults,
222
- "resultsTitle": params.autosuggest.resultsTitle,
223
- "autosuggestData": params.autosuggest.autosuggestData,
224
- "noResults": params.autosuggest.noResults,
225
- "typeMore": params.autosuggest.typeMore
226
- }) }}
227
- </div>
228
- {% endif %}
229
- <nav class="ons-header-nav ons-js-header-nav" id="{{ params.navigation.id }}" aria-label="{{ params.navigation.ariaLabel | default("Main menu") }}" data-analytics="header-navigation">
230
- <ul class="ons-header-nav__list">
231
- {% for item in (params.navigation.itemsList if params.navigation.itemsList is iterable else params.navigation.itemsList.items()) %}
232
- <li class="ons-header-nav__item {{ item.classes }}{{ ' ons-header-nav__item--active' if (item.url == params.navigation.currentPath) or (item.url != (params.navigation.siteBasePath | default('/')) and item.url in params.navigation.currentPath) }}">
233
- <a class="ons-header-nav__link" href="{{ item.url }}" {% if item.id is defined and item.id %}id="{{ item.id }}" {% endif %}>{{ item.title }}</a>
234
- </li>
235
- {% endfor %}
236
- </ul>
237
- </nav>
238
- </div>
239
- </div>
200
+ {{ onsNavigation(params.navigation) }}
240
201
  {% endif %}
241
202
  </header>
242
203
  {% endmacro %}
@@ -0,0 +1,98 @@
1
+ {% macro onsNavigation(params) %}
2
+ {% from "components/button/_macro.njk" import onsButton %}
3
+ {% from "components/autosuggest/_macro.njk" import onsAutosuggest %}
4
+ <div class="ons-navigation-wrapper">
5
+ <div class="ons-container ons-container--gutterless@xxs@l{{ ' ons-container--full-width' if params.fullWidth }}{{ ' ons-container--wide' if params.wide }}">
6
+ {% if params.siteSearchAutosuggest is defined and params.siteSearchAutosuggest and isPatternLib is defined and isPatternLib %}
7
+ <div class="ons-navigation-search ons-js-navigation-search">
8
+ {{ onsAutosuggest({
9
+ "id": "ons-site-search",
10
+ "containerClasses": "ons-autosuggest-input--header",
11
+ "classes": "ons-input--ghost ons-input-search ons-input-search--icon",
12
+ "label": {
13
+ "text": params.siteSearchAutosuggest.label,
14
+ "id": "ons-site-search-label",
15
+ "classes": "ons-label--white ons-u-pl-m"
16
+ },
17
+ "accessiblePlaceholder": true,
18
+ "autocomplete": "off",
19
+ "instructions": params.siteSearchAutosuggest.instructions,
20
+ "ariaYouHaveSelected":params.siteSearchAutosuggest.ariaYouHaveSelected,
21
+ "ariaMinChars": params.siteSearchAutosuggest.ariaMinChars,
22
+ "ariaResultsLabel": params.siteSearchAutosuggest.ariaResultsLabel,
23
+ "ariaOneResult": params.siteSearchAutosuggest.ariaOneResult,
24
+ "ariaNResults": params.siteSearchAutosuggest.ariaNResults,
25
+ "ariaLimitedResults": params.siteSearchAutosuggest.ariaLimitedResults,
26
+ "moreResults": params.siteSearchAutosuggest.moreResults,
27
+ "resultsTitle": params.siteSearchAutosuggest.resultsTitle,
28
+ "autosuggestData": params.siteSearchAutosuggest.autosuggestData,
29
+ "noResults": params.siteSearchAutosuggest.noResults,
30
+ "typeMore": params.siteSearchAutosuggest.typeMore
31
+ }) }}
32
+ </div>
33
+ {% endif %}
34
+ <nav class="ons-navigation ons-js-navigation" id="{{ params.id }}" aria-label="{{ params.ariaLabel | default("Main menu") }}" data-analytics="header-navigation">
35
+ <ul class="ons-navigation__list">
36
+ {% for item in (params.itemsList if params.itemsList is iterable else params.itemsList.items()) %}
37
+ <li class="ons-navigation__item {{ item.classes }}{{ ' ons-navigation__item--active' if (item.url == params.currentPath) or (item.url != (params.siteBasePath | default('/')) and item.url in params.currentPath) }}">
38
+ <a class="ons-navigation__link" href="{{ item.url }}" {% if item.id is defined and item.id %}id="{{ item.id }}" {% endif %}>{{ item.title }}</a>
39
+ </li>
40
+ {% endfor %}
41
+ </ul>
42
+ </nav>
43
+ </div>
44
+ </div>
45
+ {% if params.subNavigation is defined and params.subNavigation %}
46
+ <nav class="ons-navigation ons-navigation--sub ons-u-d-no@xxs@l{{ ' ' + params.subNavigation.classes if params.subNavigation.classes is defined and params.subNavigation.classes }}" id="{{ params.subNavigation.id }}" aria-label="{{ params.subNavigation.ariaLabel | default("Section menu") }}" data-analytics="header-section-navigation">
47
+ <div class="ons-container ons-container--gutterless@xxs@l{{ ' ons-container--full-width' if params.fullWidth }}{{ ' ons-container--wide' if params.wide }}">
48
+ <ul class="ons-navigation__list ons-navigation__list">
49
+ {% for item in (params.subNavigation.itemsList if params.subNavigation.itemsList is iterable else params.subNavigation.itemsList.items()) %}
50
+ <li class="ons-navigation__item ons-navigation__item {{ item.classes }}{{ ' ons-navigation__item--active' if (item.url == params.subNavigation.currentPath) or (item.url != (params.subNavigation.siteBasePath | default('/')) and item.url in params.subNavigation.currentPath) }}">
51
+ <a class="ons-navigation__link ons-navigation__link" href="{{ item.url }}" {% if item.id is defined and item.id %}id="{{ item.id }}" {% endif %}>{{ item.title }}</a>
52
+ </li>
53
+ {% endfor %}
54
+ </ul>
55
+ </div>
56
+ </nav>
57
+ <div class="ons-u-d-no@l{{ ' ' + params.subNavigation.classes if params.subNavigation.classes is defined and params.subNavigation.classes }}">
58
+ {{ onsButton({
59
+ "text": params.currentPageTitle,
60
+ "classes": "ons-u-d-no ons-js-sub-navigation-button ons-btn--dropdown",
61
+ "buttonStyle": "mobile",
62
+ "attributes": {
63
+ "aria-label": "Toggle section navigation",
64
+ "aria-controls": params.subNavigation.id,
65
+ "aria-haspopup": "true",
66
+ "aria-expanded": "false"
67
+ }
68
+ }) }}
69
+ <nav class="ons-navigation ons-navigation--sub-mobile ons-u-d-no proto-ons-js-secondary-nav ons-u-mt-xs" id="{{ params.subNavigation.id }}" aria-label="{{ params.subNavigation.ariaLabel | default("Section menu") }}" data-analytics="header-section-navigation">
70
+ <div class="ons-container ons-container--gutterless@xxs@l{{ ' ons-container--full-width' if params.fullWidth }}{{ ' ons-container--wide' if params.wide }}">
71
+ <ul class="ons-navigation__list">
72
+ <li class="ons-navigation__item">
73
+ <a class="ons-navigation__link" href="{{ params.subNavigation.overviewURL }}">{{ params.subNavigation.overviewText | default('Overview') }}</a>
74
+ </li>
75
+ {% for item in (params.subNavigation.itemsList if params.subNavigation.itemsList is iterable else params.subNavigation.itemsList.items()) %}
76
+ <li class="ons-navigation__item {{ ' ons-navigation__item--active' if (item.url == params.subNavigation.currentPath) or (item.url != (params.subNavigation.siteBasePath | default('/')) and item.url in params.subNavigation.currentPath) }}">
77
+ <a class="ons-navigation__link" href="{{ item.url }}" {% if item.id is defined and item.id %}id="{{ item.id }}" {% endif %}>{{ item.title }}</a>
78
+ {% if item.sections %}
79
+ {% for section in item.sections %}
80
+ {% if section.sectionTitle %}<h3 class="ons-navigation__list-header">{{ section.sectionTitle }}</h3>{% endif %}
81
+ <ul class="ons-navigation__list ons-list--dashed ons-u-ml-s ons-u-mt-xs">
82
+ {% for child in section.children %}
83
+ <li class="ons-navigation__item ons-list__item {{ ' ons-navigation__item--active' if (child.url == params.subNavigation.currentPath) or (child.url != (params.subNavigation.sitsiteBasePatheBasePath | default('/')) and child.url in params.subNavigation.currentPath) }}">
84
+ <a class="ons-navigation__link ons-navigation__link--section" href="{{ child.url }}" {% if child.id is defined and child.id %}id="{{ child.id }}" {% endif %}>{{ child.title }}</a>
85
+ </li>
86
+ {% endfor %}
87
+ </ul>
88
+ {% endfor %}
89
+ {% endif %}
90
+ </li>
91
+ {% endfor %}
92
+ </ul>
93
+ </div>
94
+ </nav>
95
+ </div>
96
+ {% endif %}
97
+
98
+ {% endmacro %}
@@ -0,0 +1,127 @@
1
+ .ons-navigation {
2
+ position: relative;
3
+ &-wrapper {
4
+ background: $color-header;
5
+ margin-top: -0.03rem;
6
+ }
7
+
8
+ &--sub {
9
+ background: $color-branded-tint;
10
+ padding-top: 0.5rem;
11
+ }
12
+
13
+ &--sub-mobile {
14
+ border-bottom: 4px solid $color-branded-tint;
15
+ }
16
+
17
+ &-search {
18
+ padding: 1rem;
19
+
20
+ @include mq(l) {
21
+ bottom: 65px;
22
+ padding: 0;
23
+ position: absolute;
24
+ right: 1rem;
25
+ width: 20rem;
26
+ }
27
+ }
28
+
29
+ &__list {
30
+ list-style: none;
31
+ margin: 0;
32
+ padding: 0 0 0.5rem;
33
+
34
+ @include mq(l) {
35
+ padding: 0;
36
+ }
37
+
38
+ &-header {
39
+ font-size: 1rem;
40
+ margin: 0.75rem 0 0.6rem;
41
+ padding: 0 0 0 1rem;
42
+ }
43
+ }
44
+
45
+ &__item {
46
+ border-left: 4px solid transparent;
47
+ display: block;
48
+ margin: 0 0 0.2rem;
49
+ &--active {
50
+ border-color: $color-white;
51
+ }
52
+
53
+ .ons-navigation--sub-mobile & {
54
+ &--active {
55
+ border-color: $color-branded;
56
+ li {
57
+ border: 0;
58
+ }
59
+ }
60
+ }
61
+
62
+ @include mq(l) {
63
+ border-bottom: 4px solid transparent;
64
+ border-left: 0;
65
+ display: inline-block;
66
+ margin: 0 0 0 1rem;
67
+ padding: 0 0 0.3rem;
68
+ position: relative;
69
+ text-align: center;
70
+
71
+ &:first-child {
72
+ margin-left: 0;
73
+ }
74
+
75
+ &--active,
76
+ &:hover {
77
+ border-color: $color-white;
78
+ }
79
+
80
+ .ons-navigation--sub & {
81
+ &:hover,
82
+ &--active {
83
+ border-color: $color-text-link;
84
+ }
85
+ }
86
+ }
87
+ }
88
+
89
+ &__link {
90
+ color: $color-white;
91
+ display: block;
92
+ margin: 0 0.35rem;
93
+ padding: 0.1rem 0.55rem;
94
+ text-decoration: none;
95
+
96
+ &--section {
97
+ margin: 0;
98
+ padding: 0;
99
+ }
100
+
101
+ &:hover,
102
+ &:focus {
103
+ color: $color-white;
104
+ text-decoration: none;
105
+ }
106
+
107
+ .ons-navigation--sub &,
108
+ .ons-navigation--sub-mobile & {
109
+ color: $color-text-link;
110
+ &:hover,
111
+ &:focus {
112
+ color: $color-text-link;
113
+ }
114
+ }
115
+
116
+ @include mq(l) {
117
+ display: inline-block;
118
+ font-size: 1rem;
119
+ margin: 0;
120
+ padding: 0;
121
+ }
122
+ }
123
+
124
+ &__item--active > &__link {
125
+ font-weight: 700;
126
+ }
127
+ }
@@ -0,0 +1,39 @@
1
+ import domready from '../../js/domready';
2
+
3
+ domready(async () => {
4
+ const toggleNavigationBtn = document.querySelector('.ons-js-navigation-button');
5
+ const navigationEl = document.querySelector('.ons-js-navigation');
6
+ const navigationHideClass = 'ons-u-d-no@xxs@l';
7
+ const toggleSubNavigationBtn = document.querySelector('.ons-js-sub-navigation-button');
8
+ const subNavigationEl = document.querySelector('.proto-ons-js-secondary-nav');
9
+ const subNavigationHideClass = 'ons-u-d-no';
10
+ const toggleSearchBtn = document.querySelector('.ons-js-toggle-search');
11
+ const searchEl = document.querySelector('.ons-js-navigation-search');
12
+ const searchHideClass = 'ons-u-d-no@xs@l';
13
+ const toggleServicesBtn = document.querySelector('.ons-js-toggle-services');
14
+ const servicesEl = document.querySelector('.ons-js-services-mobile-nav');
15
+ const servicesHideClass = 'ons-u-d-no';
16
+
17
+ if (toggleNavigationBtn) {
18
+ const NavigationToggle = (await import('./navigation')).default;
19
+
20
+ new NavigationToggle(toggleNavigationBtn, navigationEl, navigationHideClass).registerEvents();
21
+ }
22
+
23
+ if (toggleSubNavigationBtn) {
24
+ const SubNavigationToggle = (await import('./navigation')).default;
25
+ new SubNavigationToggle(toggleSubNavigationBtn, subNavigationEl, subNavigationHideClass).registerEvents();
26
+ }
27
+
28
+ if (toggleSearchBtn) {
29
+ const searchToggle = (await import('./navigation')).default;
30
+
31
+ new searchToggle(toggleSearchBtn, searchEl, searchHideClass).registerEvents();
32
+ }
33
+
34
+ if (toggleServicesBtn) {
35
+ const servicesToggle = (await import('./navigation')).default;
36
+
37
+ new servicesToggle(toggleServicesBtn, servicesEl, servicesHideClass).registerEvents();
38
+ }
39
+ });
@@ -5,10 +5,10 @@ import onViewportChange from '../../js/utils/viewport-change';
5
5
  const attrExpanded = 'aria-expanded';
6
6
  const attrHidden = 'aria-hidden';
7
7
 
8
- export default class NavToggle {
9
- constructor(toggle, nav, hideClass) {
8
+ export default class NavigationToggle {
9
+ constructor(toggle, navigation, hideClass) {
10
10
  this.toggle = toggle;
11
- this.nav = nav;
11
+ this.navigation = navigation;
12
12
  this.hideClass = hideClass;
13
13
  this.toggle.classList.remove('ons-u-d-no');
14
14
  this.setAria();
@@ -20,17 +20,17 @@ export default class NavToggle {
20
20
  }
21
21
 
22
22
  toggleNav() {
23
- const isHidden = this.nav.getAttribute(attrHidden);
23
+ const isHidden = this.navigation.getAttribute(attrHidden);
24
24
  isHidden === 'false' ? this.closeNav() : this.openNav();
25
25
  }
26
26
 
27
27
  openNav() {
28
- const input = [...this.nav.getElementsByTagName('INPUT')][0];
28
+ const input = [...this.navigation.getElementsByTagName('INPUT')][0];
29
29
 
30
30
  this.toggle.setAttribute(attrExpanded, 'true');
31
31
  this.toggle.classList.add('active');
32
- this.nav.setAttribute(attrHidden, 'false');
33
- this.nav.classList.remove(this.hideClass);
32
+ this.navigation.setAttribute(attrHidden, 'false');
33
+ this.navigation.classList.remove(this.hideClass);
34
34
 
35
35
  if (input) {
36
36
  input.focus();
@@ -40,23 +40,23 @@ export default class NavToggle {
40
40
  closeNav() {
41
41
  this.toggle.setAttribute(attrExpanded, 'false');
42
42
  this.toggle.classList.remove('active');
43
- this.nav.setAttribute(attrHidden, 'true');
44
- this.nav.classList.add(this.hideClass);
43
+ this.navigation.setAttribute(attrHidden, 'true');
44
+ this.navigation.classList.add(this.hideClass);
45
45
  }
46
46
 
47
47
  setAria() {
48
48
  const viewportDetails = GetViewportDetails();
49
- const hasAria = this.nav.hasAttribute(attrHidden);
49
+ const hasAria = this.navigation.hasAttribute(attrHidden);
50
50
 
51
- if (viewportDetails.width < 740) {
51
+ if (viewportDetails.width < 980) {
52
52
  if (!hasAria) {
53
53
  this.closeNav();
54
54
  }
55
55
  } else if (hasAria) {
56
56
  this.toggle.removeAttribute(attrExpanded);
57
- this.nav.removeAttribute(attrHidden);
57
+ this.navigation.removeAttribute(attrHidden);
58
58
  if (this.hideClass !== 'ons-u-d-no') {
59
- this.nav.classList.remove(this.hideClass);
59
+ this.navigation.classList.remove(this.hideClass);
60
60
  } else {
61
61
  this.closeNav();
62
62
  }
@@ -1,6 +1,6 @@
1
1
  {% macro onsSectionNavigation(params) %}
2
2
  <nav class="ons-section-nav{% if params.variants is defined and params.variants == 'vertical' %} ons-section-nav--vertical{% endif %}" id="{{ params.id }}" aria-label="{{ params.ariaLabel | default("Section menu") }}">
3
- <ul class="ons-section-nav__list" aria-label="{{ params.ariaListLabel | default("Section menu links") }}">
3
+ <ul class="ons-section-nav__list">
4
4
  {% for item in (params.itemsList if params.itemsList is iterable else params.itemsList.items()) %}
5
5
  <li class="ons-section-nav__item {{ item.classes }}{{ ' ons-section-nav__item--active' if (item.url == params.currentPath) or (item.url in params.currentPath) or (params.tabQuery == item.title|lower) }}">
6
6
  <a class="ons-section-nav__link" href="{{ item.url }}" {% if (item.url == params.currentPath) or (item.url in params.currentPath) or (params.tabQuery == item.title|lower) %} aria-current="location" {% endif %}>{{ item.title }}</a>