link.setAttribute("aria-current", "page");
}
+ if (menuItem.counter > 0) {
+ const counter = document.createElement("span");
+ counter.classList.add("pageMenuMainItemCounter", "badge", "badgeUpdate");
+ counter.setAttribute("aria-hidden", "true");
+ counter.textContent = menuItem.counter.toString();
+
+ link.append(counter);
+ }
+
listItem.append(link);
} else {
const label = document.createElement("a");
listItem.append(label);
}
- if (menuItem.counter > 0) {
- const counter = document.createElement("span");
- counter.classList.add("pageMenuMainItemCounter", "badge", "badgeUpdate");
- counter.setAttribute("aria-hidden", "true");
- counter.textContent = menuItem.counter.toString();
-
- listItem.classList.add("pageMenuMainItemOutstandingItems");
- listItem.append(counter);
- }
-
if (menuItem.children.length) {
listItem.classList.add("pageMenuMainItemExpandable");
if (menuItem.active) {
link.setAttribute("aria-current", "page");
}
+ if (menuItem.counter > 0) {
+ const counter = document.createElement("span");
+ counter.classList.add("pageMenuMainItemCounter", "badge", "badgeUpdate");
+ counter.setAttribute("aria-hidden", "true");
+ counter.textContent = menuItem.counter.toString();
+ link.append(counter);
+ }
listItem.append(link);
}
else {
label.setAttribute("aria-hidden", "true");
listItem.append(label);
}
- if (menuItem.counter > 0) {
- const counter = document.createElement("span");
- counter.classList.add("pageMenuMainItemCounter", "badge", "badgeUpdate");
- counter.setAttribute("aria-hidden", "true");
- counter.textContent = menuItem.counter.toString();
- listItem.classList.add("pageMenuMainItemOutstandingItems");
- listItem.append(counter);
- }
if (menuItem.children.length) {
listItem.classList.add("pageMenuMainItemExpandable");
const menuId = Util_1.default.getUniqueId();
position: relative;
}
-.pageMenuMainItemOutstandingItems {
- grid-template-areas: "item counter";
- grid-template-columns: auto min-content;
-
- &:not(.pageMenuMainItemExpandable) {
- padding-right: 10px;
- }
-}
-
.pageMenuMainItemExpandable {
grid-template-areas:
"item button"
"list list";
grid-template-columns: auto 44px;
-
- &.pageMenuMainItemOutstandingItems {
- grid-template-areas:
- "item counter button"
- "list list list";
- grid-template-columns: auto min-content 44px;
- }
}
.pageMenuMainItemLabel,
.pageMenuMainItemCounter {
align-self: center;
+ border-radius: 4px;
grid-area: counter;
+ margin-left: 8px;
white-space: nowrap;
}