Skip to content

Commit

Permalink
make offcanvas filters work
Browse files Browse the repository at this point in the history
  • Loading branch information
longhotsummer committed Jul 16, 2024
1 parent ac648da commit a9c4c14
Show file tree
Hide file tree
Showing 7 changed files with 98 additions and 315 deletions.
215 changes: 0 additions & 215 deletions peachjam/js/components/ListFacets.vue

This file was deleted.

19 changes: 19 additions & 0 deletions peachjam/js/components/document-filter-form.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
export default class DocumentFilterForm {
public root: HTMLElement;

constructor (root: HTMLElement) {
this.root = root;
// on small displays, move the filters into the offcanvas element
if (window.innerWidth < 992) {
this.moveFiltersToOffcanvas();
}
}

moveFiltersToOffcanvas () {
const offcanvas = this.root.querySelector('.offcanvas-body');
const content = this.root.querySelector('.document-list-facets');
if (offcanvas && content) {
offcanvas.appendChild(content);
}
}
}
31 changes: 0 additions & 31 deletions peachjam/js/components/document-list.ts

This file was deleted.

4 changes: 2 additions & 2 deletions peachjam/js/components/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { CopyToClipboard } from './clipboard';
import { RelationshipEnrichments } from './RelationshipEnrichment';
import DocumentList from './document-list';
import DocumentFilterForm from './document-filter-form';
import DocumentTable from './document-table';
import DocumentContent from './DocumentContent/index';
import NavigationSelect from './navigation-select';
Expand All @@ -16,8 +16,8 @@ const components: Record<string, any> = {
// Data components
CopyToClipboard,
DocumentContent,
DocumentFilterForm,
DocumentTable,
DocumentList,
NavigationSelect,
RelationshipEnrichments,
ToggleTab,
Expand Down
2 changes: 1 addition & 1 deletion peachjam/static/js/app-prod.js

Large diffs are not rendered by default.

Loading

0 comments on commit a9c4c14

Please sign in to comment.