Skip to content

Commit

Permalink
Format files
Browse files Browse the repository at this point in the history
  • Loading branch information
CountNick committed Jun 20, 2024
1 parent 86dc5a3 commit 7e61f25
Show file tree
Hide file tree
Showing 8 changed files with 13 additions and 18 deletions.
2 changes: 1 addition & 1 deletion index.mjs
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
import CookieConsent from "./src/cookie-consent.mjs";

export default CookieConsent;
export default CookieConsent;
17 changes: 6 additions & 11 deletions src/dialog-tablist.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,9 @@ const DialogTabList = (cookieInformation) => {
* `required: false`, because of #3)
* 3. Use the `checked` setting.
*/
const shouldBeChecked =
typeof accepted !== "undefined"
? accepted
: required === true
const shouldBeChecked = typeof accepted !== "undefined"
? accepted
: required === true
? required
: checked;

Expand Down Expand Up @@ -96,9 +95,7 @@ const DialogTabList = (cookieInformation) => {
: undefined,
}));
return `
<ul part="${PREFIX}__tab-list" class="${PREFIX}__tab-list" role="tablist" aria-label="${Config().get(
"labels.aria.tabList"
)}">
<ul part="${PREFIX}__tab-list" class="${PREFIX}__tab-list" role="tablist" aria-label="${Config().get("labels.aria.tabList")}">
${cookiesWithState.map(renderTab).join("")}
</ul>
`;
Expand Down Expand Up @@ -127,8 +124,7 @@ const DialogTabList = (cookieInformation) => {
const controls = targetTab ? targetTab.getAttribute("aria-controls") : "";
tabs.forEach((tab) => tab.setAttribute("aria-selected", tab === targetTab));
panels.forEach((panel) =>
panel.setAttribute("aria-hidden", controls !== panel.id)
);
panel.setAttribute("aria-hidden", controls !== panel.id));
};

/**
Expand All @@ -140,8 +136,7 @@ const DialogTabList = (cookieInformation) => {
tabs.forEach((tab) => {
tab.addEventListener("click", (e) => {
e.preventDefault();
const targetTab =
tab.getAttribute("aria-selected") === "true" ? null : tab;
const targetTab = tab.getAttribute("aria-selected") === "true" ? null : tab;
selectTab({ tabs, panels, targetTab });
});
});
Expand Down
2 changes: 1 addition & 1 deletion src/dom-toggler.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -114,4 +114,4 @@ const DomToggler = (config) => {
};
};

export default DomToggler;
export default DomToggler;
2 changes: 1 addition & 1 deletion src/event-dispatcher.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,4 @@ const EventDispatcher = () => {

};

export default EventDispatcher;
export default EventDispatcher;
2 changes: 1 addition & 1 deletion src/preferences.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,4 @@ const Preferences = (prefix) => {
};
};

export default Preferences;
export default Preferences;
2 changes: 1 addition & 1 deletion src/storage.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,4 @@ const Storage = () => {
};
};

export default Storage;
export default Storage;
2 changes: 1 addition & 1 deletion src/toggle-dialog-visibility.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ const toggleDialogVisibility = (dialogElement) => {
};
};

export default toggleDialogVisibility;
export default toggleDialogVisibility;
2 changes: 1 addition & 1 deletion src/utils.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,4 @@ export const getEntryByDotString = (object, entryString) => {
}
return undefined;
}, object);
};
};

0 comments on commit 7e61f25

Please sign in to comment.