Skip to content

Commit

Permalink
Tweak facets.js, revert revert of build.xml.
Browse files Browse the repository at this point in the history
  • Loading branch information
EreMaijala committed May 29, 2024
1 parent 6eb95d0 commit fee8613
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 9 deletions.
5 changes: 2 additions & 3 deletions build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -999,7 +999,7 @@ ${git_status}
</if>
<mkdir dir="${templatesdir}"></mkdir>
<copy todir="${templatesdir}">
<fileset dir="${srcdir}/themes/bootstrap5/templates" defaultexcludes="false">
<fileset dir="${srcdir}/themes/bootstrap5/templates">
<exclude name="header.phtml" />
<exclude name="RecordTab/similaritemscarousel.phtml" />
</fileset>
Expand Down Expand Up @@ -1041,7 +1041,7 @@ ${git_status}
</if>
<mkdir dir="${templatesdir}"></mkdir>
<copy todir="${templatesdir}">
<fileset dir="${srcdir}/themes/bootstrap3/templates" defaultexcludes="false">
<fileset dir="${srcdir}/themes/bootstrap3/templates">
<exclude name="header.phtml" />
<exclude name="RecordTab/similaritemscarousel.phtml" />
</fileset>
Expand Down Expand Up @@ -1094,7 +1094,6 @@ ${git_status}
<exclude name="account_ajax.js" />
<exclude name="cart.js" />
<exclude name="channels.js" />
<exclude name="facets.js" />
<exclude name="lightbox.js" />
<exclude name="vendor" />
<exclude name="vendor/bootstrap-accessibility.min.js" />
Expand Down
4 changes: 1 addition & 3 deletions themes/bootstrap3/js/facets.js
Original file line number Diff line number Diff line change
Expand Up @@ -226,13 +226,11 @@ VuFind.register('sideFacets', function SideFacets() {
$('.facet-group').on('hidden.bs.collapse', (e) => facetSessionStorage(e, 'collapsed'));

// Side facets loaded with AJAX
if (typeof bootstrap === 'undefined') {
// Bootstrap 3:
if (VuFind.getBootstrapMajorVersion() === 3) {
$('.side-facets-container-ajax')
.find('div.collapse[data-facet]:not(.in)')
.on('shown.bs.collapse', loadAjaxSideFacets);
} else {
// Bootstrap 5:
document.querySelectorAll('.side-facets-container-ajax div[data-facet]').forEach((collapseEl) => {
collapseEl.addEventListener('shown.bs.collapse', loadAjaxSideFacets);
});
Expand Down
4 changes: 1 addition & 3 deletions themes/bootstrap5/js/facets.js
Original file line number Diff line number Diff line change
Expand Up @@ -226,13 +226,11 @@ VuFind.register('sideFacets', function SideFacets() {
$('.facet-group').on('hidden.bs.collapse', (e) => facetSessionStorage(e, 'collapsed'));

// Side facets loaded with AJAX
if (typeof bootstrap === 'undefined') {
// Bootstrap 3:
if (VuFind.getBootstrapMajorVersion() === 3) {
$('.side-facets-container-ajax')
.find('div.collapse[data-facet]:not(.in)')
.on('shown.bs.collapse', loadAjaxSideFacets);
} else {
// Bootstrap 5:
document.querySelectorAll('.side-facets-container-ajax div[data-facet]').forEach((collapseEl) => {
collapseEl.addEventListener('shown.bs.collapse', loadAjaxSideFacets);
});
Expand Down

0 comments on commit fee8613

Please sign in to comment.