Skip to content

Commit

Permalink
Switch to first non-empty search tab.
Browse files Browse the repository at this point in the history
Only happens when we are on the text tab, and after all searches have
returned.

Fixes #583
  • Loading branch information
thvitt committed May 13, 2021
1 parent 5cdd62b commit 600b678
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions search.php
Original file line number Diff line number Diff line change
Expand Up @@ -218,10 +218,16 @@
document.getElementById("breadcrumbs").appendChild(Faust.createBreadcrumbs([{caption: "Suche"}, {caption: state.current.q}]));

// Initially perform the queries
searchTexts();
searchMetadata();
searchTestimony();
searchInfo();
Promise.all([
searchTexts(),
searchMetadata(),
searchTestimony(),
searchInfo()
]).then(function () {
if (state.current.tab == "texts") {
$('.tab-bar [data-badge!="0"]').first().click();
}
});

} catch (e) {
Faust.error('Bug in der interaktiven Suche', e);
Expand Down

0 comments on commit 600b678

Please sign in to comment.