mirror of
https://github.com/TrentSPalmer/hugo_themes_report.git
synced 2025-11-21 02:08:25 -08:00
add filter by license
This commit is contained in:
40
templates/js/buildSelectionDivs.js
Normal file
40
templates/js/buildSelectionDivs.js
Normal file
@@ -0,0 +1,40 @@
|
||||
// called from buildSelectionMenu.js
|
||||
function buildSelectionDiv(
|
||||
selectedItems,
|
||||
availableItems,
|
||||
sortBy,
|
||||
dStateSelectionRow,
|
||||
dStateSelectionHeadingRow,
|
||||
eParent,
|
||||
menuSection
|
||||
) {
|
||||
// from buildSelectionHeadingRows.js
|
||||
buildSelectionHeadingRow(
|
||||
eParent,
|
||||
sortBy,
|
||||
dStateSelectionHeadingRow,
|
||||
menuSection
|
||||
);
|
||||
|
||||
let selectionRow = document.createElement("div");
|
||||
selectionRow.id = `${menuSection}SelectionRow`;
|
||||
selectionRow.style.display = dStateSelectionRow;
|
||||
selectionRow.style.flexWrap = "wrap";
|
||||
selectionRow.style.justifyContent = "space-around";
|
||||
|
||||
eParent.appendChild(selectionRow);
|
||||
|
||||
availableItems
|
||||
.filter((x) => selectedItems.includes(x[menuSection]))
|
||||
.forEach((y) => {
|
||||
// from buildSelectionInputs.js
|
||||
buildInput(y, true, selectionRow);
|
||||
});
|
||||
|
||||
availableItems
|
||||
.filter((x) => !selectedItems.includes(x[menuSection]))
|
||||
.forEach((y) => {
|
||||
// from buildSelectionInputs.js
|
||||
buildInput(y, false, selectionRow);
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user