fix: make nav controller more universal
This commit is contained in:
+4
@@ -21,7 +21,10 @@ export default class extends Controller {
|
|||||||
}
|
}
|
||||||
|
|
||||||
expandedValueChanged(expanded) {
|
expandedValueChanged(expanded) {
|
||||||
|
if (this.hasButtonTarget) {
|
||||||
this.buttonTarget.setAttribute('aria-expanded', expanded)
|
this.buttonTarget.setAttribute('aria-expanded', expanded)
|
||||||
|
}
|
||||||
|
if (this.hasSubnavTarget) {
|
||||||
this.subnavTarget.setAttribute('aria-hidden', !expanded)
|
this.subnavTarget.setAttribute('aria-hidden', !expanded)
|
||||||
if (true === expanded) {
|
if (true === expanded) {
|
||||||
this.subnavTarget.classList.remove(...this.hiddenClasses)
|
this.subnavTarget.classList.remove(...this.hiddenClasses)
|
||||||
@@ -30,3 +33,4 @@ export default class extends Controller {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user