See https://www.woltlab.com/community/thread/299236-externe-hauptmen%C3%BC-links-werden-trotz-einstellung-im-acp-mobil-nicht-in-neuem-tab/
if (menuItem.identifier) {
link.dataset.identifier = menuItem.identifier;
}
+ if (menuItem.openInNewWindow) {
+ link.target = "_blank";
+ }
if (menuItem.counter > 0) {
const counter = document.createElement("span");
// `link.href` represents the computed link, not the raw value.
const href = anchor.getAttribute("href");
let link: string | undefined = undefined;
+ let openInNewWindow: boolean | undefined = undefined;
if (href && href !== "#") {
link = anchor.href;
+
+ if (anchor.target === "_blank") {
+ openInNewWindow = true;
+ }
}
const active = menuItem.classList.contains("active");
depth,
identifier,
link,
+ openInNewWindow,
title,
};
}
depth: MenuItemDepth;
identifier: string | null;
link?: string;
+ openInNewWindow?: boolean;
title: string;
};
if (menuItem.identifier) {
link.dataset.identifier = menuItem.identifier;
}
+ if (menuItem.openInNewWindow) {
+ link.target = "_blank";
+ }
if (menuItem.counter > 0) {
const counter = document.createElement("span");
counter.classList.add("pageMenuMainItemCounter", "badge", "badgeUpdate");
// `link.href` represents the computed link, not the raw value.
const href = anchor.getAttribute("href");
let link = undefined;
+ let openInNewWindow = undefined;
if (href && href !== "#") {
link = anchor.href;
+ if (anchor.target === "_blank") {
+ openInNewWindow = true;
+ }
}
const active = menuItem.classList.contains("active");
const identifier = anchor.parentElement.dataset.identifier;
depth,
identifier,
link,
+ openInNewWindow,
title,
};
}