import UiCloseOverlay from "../../CloseOverlay";
import DomUtil from "../../../Dom/Util";
-export const enum Orientation {
- Left = "left",
- Right = "right",
-}
-
export class PageMenuContainer {
private readonly container = document.createElement("div");
private readonly content = document.createElement("div");
private focusTrap?: FocusTrap = undefined;
- private readonly orientation: Orientation;
private readonly provider: PageMenuProvider;
- constructor(provider: PageMenuProvider, orientation: Orientation) {
+ constructor(provider: PageMenuProvider) {
this.provider = provider;
- this.orientation = orientation;
// Set the container to be initially hidden, otherwise the detection in
// `toggle()` incorrectly assumes the container to be visible on first click.
}
this.container.classList.add("pageMenuContainer");
- this.container.dataset.orientation = this.orientation;
this.container.hidden = true;
this.container.addEventListener("click", (event) => {
if (event.target === this.container) {
* @module WoltLabSuite/Core/Ui/Page/Menu/Main
*/
-import PageMenuContainer, { Orientation } from "./Container";
+import PageMenuContainer from "./Container";
import { PageMenuProvider } from "./Provider";
import * as Language from "../../../Language";
import DomUtil from "../../../Dom/Util";
this.mainMenu = document.querySelector(".mainMenu")!;
this.menuItemProvider = menuItemProvider;
- this.container = new PageMenuContainer(this, Orientation.Left);
+ this.container = new PageMenuContainer(this);
this.callbackOpen = (event) => {
event.preventDefault();
* @woltlabExcludeBundle tiny
*/
-import PageMenuContainer, { Orientation } from "./Container";
+import PageMenuContainer from "./Container";
import { PageMenuProvider } from "./Provider";
import * as Language from "../../../Language";
import { getUserMenuProviders } from "../../User/Menu/Manager";
constructor() {
this.userMenu = document.querySelector(".userPanel")!;
- this.container = new PageMenuContainer(this, Orientation.Right);
+ this.container = new PageMenuContainer(this);
const isReady = new Promise<void>((resolve) => {
if (document.readyState === "complete") {
CloseOverlay_1 = tslib_1.__importDefault(CloseOverlay_1);
Util_1 = tslib_1.__importDefault(Util_1);
class PageMenuContainer {
- constructor(provider, orientation) {
+ constructor(provider) {
this.container = document.createElement("div");
this.content = document.createElement("div");
this.focusTrap = undefined;
this.provider = provider;
- this.orientation = orientation;
// Set the container to be initially hidden, otherwise the detection in
// `toggle()` incorrectly assumes the container to be visible on first click.
this.container.hidden = true;
return;
}
this.container.classList.add("pageMenuContainer");
- this.container.dataset.orientation = this.orientation;
this.container.hidden = true;
this.container.addEventListener("click", (event) => {
if (event.target === this.container) {
constructor(menuItemProvider) {
this.mainMenu = document.querySelector(".mainMenu");
this.menuItemProvider = menuItemProvider;
- this.container = new Container_1.default(this, "left" /* Left */);
+ this.container = new Container_1.default(this);
this.callbackOpen = (event) => {
event.preventDefault();
event.stopPropagation();
this.tabPanels = new Map();
this.tabs = [];
this.userMenu = document.querySelector(".userPanel");
- this.container = new Container_1.default(this, "right" /* Right */);
+ this.container = new Container_1.default(this);
const isReady = new Promise((resolve) => {
if (document.readyState === "complete") {
resolve();
width: 400px;
}
- .pageMenuContainer[data-orientation="right"] .pageMenuContent {
- margin-left: auto;
- }
-
.pageMenuContent {
box-shadow: 0 0 20px rgba(0, 0, 0, 0.19), 0 0 6px rgb(0, 0, 0, 0.23);
+ margin-left: auto;
width: 400px;
}
}