me}.open` : null; if (prefName && Services.prefs.prefHasUserValue(prefName)) { return Services.prefs.getBoolPref(prefName); } return null; } connectedCallback() { super.connectedCallback(); this.isExpanded = this.detailsOpenPrefValue ?? this.initiallyExpanded; } onToggleContainer() { if (this.isExpanded == this.detailsExpanded) { return; } this.isExpanded = this.detailsExpanded; this.updateTabLists(); if (!this.shortPageName) { return; } if (this.preserveCollapseState) { const prefName = this.shortPageName ? `browser.tabs.firefox-view.ui-state.${this.shortPageName}.open` : null; Services.prefs.setBoolPref(prefName, this.isExpanded); } // Record telemetry Glean.firefoxviewNext[ `card${this.isExpanded ? "Expanded" : "Collapsed"}CardContainer` ].record({ data_type: this.shortPageName, }); } viewAllClicked() { this.dispatchEvent( new CustomEvent("card-container-view-all", { bubbles: true, composed: true, }) ); } willUpdate(changes) { if (changes.has("visible")) { this.updateTabLists(); } } updateTabLists() { let tabLists = this.querySelectorAll( "fxview-tab-list, opentabs-tab-list, syncedtabs-tab-list" ); if (tabLists) { tabLists.forEach(tabList => { tabList.updatesPaused = !this.visible || !this.isExpanded; }); } } render() { return html` ${when( this.toggleDisabled, () => html`
`, () => html`