Skip to content

Commit

Permalink
Linting
Browse files Browse the repository at this point in the history
  • Loading branch information
janfaracik committed Feb 10, 2024
1 parent 7270712 commit 069fefb
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 13 deletions.
5 changes: 3 additions & 2 deletions war/src/main/js/components/dropdowns/overflow-button.js
Expand Up @@ -11,12 +11,13 @@ function init() {
1000,
(element) => {
Utils.generateDropdown(element, (instance) => {
const elements = element.nextElementSibling.content.children[0].children;
const elements =
element.nextElementSibling.content.children[0].children;
const mappedItems = Utils.convertHtmlToItems(elements);

instance.setContent(Utils.generateDropdownItems(mappedItems));
});
}
},
);
}

Expand Down
20 changes: 9 additions & 11 deletions war/src/main/js/components/dropdowns/utils.js
Expand Up @@ -142,7 +142,7 @@ function generateDropdownItems(items, compact) {

function convertHtmlToItems(children) {
const items = [];
Array.from(children).forEach(child => {
Array.from(children).forEach((child) => {
const attributes = child.dataset;
const type = child.dataset.dropdownType;

Expand All @@ -152,7 +152,7 @@ function convertHtmlToItems(children) {
label: attributes.dropdownText,
id: attributes.dropdownId,
icon: attributes.dropdownIcon,
iconXml: attributes.dropdownIcon
iconXml: attributes.dropdownIcon,
};

if (attributes.dropdownHref) {
Expand All @@ -165,15 +165,13 @@ function convertHtmlToItems(children) {
items.push(item);
break;
case "SUBMENU":
items.push(
{
type: "ITEM",
label: attributes.dropdownText,
icon: attributes.dropdownIcon,
iconXml: attributes.dropdownIcon,
subMenu: () => convertHtmlToItems(child.content.children)
}
);
items.push({
type: "ITEM",
label: attributes.dropdownText,
icon: attributes.dropdownIcon,
iconXml: attributes.dropdownIcon,
subMenu: () => convertHtmlToItems(child.content.children),
});
break;
case "SEPARATOR":
items.push({ type: type });
Expand Down

0 comments on commit 069fefb

Please sign in to comment.