Skip to content

Commit

Permalink
Dispatch event to switch on ?tab=about tab when resultCount is 0 (#282)
Browse files Browse the repository at this point in the history
* Dispatch event to switch on ?tab=about tab when resultCount is 0
  • Loading branch information
nsharma123 authored Aug 10, 2023
1 parent 969f24f commit ec93253
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/collection-browser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1300,6 +1300,10 @@ export class CollectionBrowser
);
}

private emitEmptyResults() {
this.dispatchEvent(new Event('emptyResults'));
}

private disconnectResizeObserver(
resizeObserver: SharedResizeObserverInterface
) {
Expand Down Expand Up @@ -1980,6 +1984,11 @@ export class CollectionBrowser

this.totalResults = success.response.totalResults - this.tileModelOffset;

// display event to offshoot when result count is zero.
if (this.totalResults === 0) {
this.emitEmptyResults();
}

if (this.withinCollection) {
this.collectionInfo = success.response.collectionExtraInfo;

Expand Down

0 comments on commit ec93253

Please sign in to comment.