Skip to content

Commit 43f2951

Browse files
authored
Allow facetPaneVisible prop to function without smart facets (#499)
* Allow facetPaneVisible prop to function even without smart facets * Make facetPaneVisible property reflected to attr * Remove unused import in app-root
1 parent f5502ff commit 43f2951

File tree

2 files changed

+5
-9
lines changed

2 files changed

+5
-9
lines changed

src/app-root.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ import type { AnalyticsManagerInterface } from '@internetarchive/analytics-manag
1616
import type { CollectionBrowser } from '../src/collection-browser';
1717

1818
import '../src/collection-browser';
19-
import { StringField } from '@internetarchive/iaux-item-metadata';
2019

2120
@customElement('app-root')
2221
export class AppRoot extends LitElement {
@@ -490,6 +489,7 @@ export class AppRoot extends LitElement {
490489
</div>
491490
<div id="collection-browser-container">
492491
<collection-browser
492+
facetPaneVisible
493493
.baseNavigationUrl=${'https://archive.org'}
494494
.baseImageUrl=${'https://archive.org'}
495495
.searchService=${this.searchService}

src/collection-browser.ts

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,7 @@ export class CollectionBrowser
239239
*/
240240
@property({ type: String }) facetLoadStrategy: FacetLoadStrategy = 'eager';
241241

242-
@property({ type: Boolean }) facetPaneVisible = false;
242+
@property({ type: Boolean, reflect: true }) facetPaneVisible = false;
243243

244244
@property({ type: Boolean }) clearResultsOnEmptyQuery = false;
245245

@@ -678,14 +678,10 @@ export class CollectionBrowser
678678
*/
679679
private get desktopLeftColumnTemplate(): TemplateResult {
680680
return html`
681-
<div
682-
id="left-column"
683-
class="column"
684-
?hidden=${this.showSmartFacetBar && !this.facetPaneVisible}
685-
>
681+
<div id="left-column" class="column" ?hidden=${!this.facetPaneVisible}>
686682
${this.facetTopViewSlot}
687683
<div id="facets-header-container">
688-
<h2 id="facets-header" class="sr-only">Filters</h2>
684+
<h2 id="facets-header" class="sr-only">${msg('Filters')}</h2>
689685
${this.resultsCountTemplate} ${this.clearFiltersBtnTemplate(false)}
690686
</div>
691687
<div id="facets-container" aria-labelledby="facets-header">
@@ -739,7 +735,7 @@ export class CollectionBrowser
739735
private get rightColumnTemplate(): TemplateResult {
740736
const rightColumnClasses = classMap({
741737
column: true,
742-
'full-width': this.showSmartFacetBar && !this.facetPaneVisible,
738+
'full-width': !this.facetPaneVisible,
743739
'smart-results-spacing': !!this.showSmartResults,
744740
});
745741

0 commit comments

Comments
 (0)