+ updateActiveState() {
+ const active = window.innerWidth < this.activeUnder;
+ if (active === this.active) {
+ return;
+ }
+
+ if (active) {
+ this.activate();
+ } else {
+ this.deactivate();
+ }
+
+ this.active = active;
+ }
+
+ activate() {
+ const panelToShow = this.panels.find(p => !p.hasAttribute('hidden')) || this.panels[0];
+ this.show(panelToShow.id);
+ this.tabList.toggleAttribute('hidden', false);
+ }
+
+ deactivate() {
+ for (const panel of this.panels) {
+ panel.removeAttribute('hidden');
+ }
+ for (const tab of this.tabs) {
+ tab.setAttribute('aria-selected', 'false');
+ }
+ this.tabList.toggleAttribute('hidden', true);
+ }
+
+}