Skip to content

Commit

Permalink
details
Browse files Browse the repository at this point in the history
Add facets details style
  • Loading branch information
protitude committed Feb 25, 2025
1 parent 70996a5 commit e1a24d1
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 0 deletions.
26 changes: 26 additions & 0 deletions components/01-atoms/details/_details.scss
Original file line number Diff line number Diff line change
Expand Up @@ -52,3 +52,29 @@ summary {
background: $gray-lightest;
}
}

html:has(main .view-facets) {
.sidebar-left .views-exposed-form {
details {
display: block;
}
}
.views-exposed-form {
details {
background: none;
border-left: none;
border-right: none;
border-top: none;

summary {
background: none;
border: none;
font-family: "Roboto Condensed", "Helvetica Neue", Helvetica, Arial, sans-serif;
font-size: 1.2rem;
font-weight: normal;
text-transform: uppercase;
margin-bottom: 0;
}
}
}
}
7 changes: 7 additions & 0 deletions components/01-atoms/details/details.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,27 @@
"use strict";

var dtn = $( ".main-content details" ).length;

function detailsControls(placement) {
$(placement).before('<div class="detail-control"><button class="button-internal open-deets">Open All</button> <button class="button-internal button-internal--active close-deets">Collapse All</button></div>');
}

if ( dtn > 2 && !$('details').hasClass("no-deets-controls") && !$('div').hasClass("deets-controls-here") ) {
detailsControls('.main-content details:first');
}

if ( $('div').hasClass("deets-controls-here") ) {
detailsControls(".deets-controls-here");
}

$('button.open-deets').click(function() {
$('details').attr('open', '');
});

$('button.close-deets').click(function() {
$('details').removeAttr('open');
});

$('html:has(main .view-facets) .views-exposed-form details').attr('open', 'open');

})(jQuery, Drupal);

0 comments on commit e1a24d1

Please sign in to comment.