Bento/assets/js/lists.js

41 lines
1.1 KiB
JavaScript
Raw Normal View History

2021-07-20 20:50:46 -05:00
console.log("Connected lists");
const printFirstList = () => {
let icon = `<i class="list__head" data-feather="${CONFIG.firstListIcon}"></i>`;
const position = "beforeend";
list_1.insertAdjacentHTML(position, icon);
for (const link of CONFIG.lists.firstList) {
let item = `
<a
2021-07-20 21:28:00 -05:00
target="${CONFIG.openInNewTab ? "_blank" : ""}"
2021-07-20 20:50:46 -05:00
href="${link.link}"
class="list__link"
>${link.name}</a
>
`;
const position = "beforeend";
list_1.insertAdjacentHTML(position, item);
}
};
const printSecondList = () => {
2021-07-20 21:28:00 -05:00
let icon = `<i class="list__head" data-feather="${CONFIG.secondListIcon}"></i>`;
2021-07-20 20:50:46 -05:00
const position = "beforeend";
2021-07-20 21:28:00 -05:00
list_2.insertAdjacentHTML(position, icon);
2021-07-20 20:50:46 -05:00
for (const link of CONFIG.lists.secondList) {
let item = `
<a
2021-07-20 21:28:00 -05:00
target="${CONFIG.openInNewTab ? "_blank" : ""}"
2021-07-20 20:50:46 -05:00
href="${link.link}"
class="list__link"
>${link.name}</a
>
`;
const position = "beforeend";
list_2.insertAdjacentHTML(position, item);
}
};
printFirstList();
printSecondList();