fix(mobile): position of note detail menu (closes #971)

This commit is contained in:
Elian Doran 2025-01-18 00:04:06 +02:00
parent e3bcd75a5a
commit 7cf1fbf088
No known key found for this signature in database
3 changed files with 6 additions and 2 deletions

View File

@ -8,6 +8,8 @@ interface ContextMenuOptions<T extends CommandNames> {
orientation?: "left";
selectMenuItemHandler: MenuHandler<T>;
items: MenuItem<T>[];
/** On mobile, if set to `true` then the context menu is shown near the element. If `false` (default), then the context menu is shown at the bottom of the screen. */
forcePositionOnMobile?: boolean;
}
interface MenuSeparatorItem {
@ -60,6 +62,7 @@ class ContextMenu {
await this.hide();
}
this.$widget.toggleClass("mobile-bottom-menu", !this.options.forcePositionOnMobile);
this.$cover.addClass("show");
$("body").addClass("context-menu-shown");

View File

@ -52,7 +52,8 @@ class MobileDetailMenuWidget extends BasicWidget {
} else {
throw new Error(t("mobile_detail_menu.error_unrecognized_command", { command }));
}
}
},
forcePositionOnMobile: true
});
});
}

View File

@ -1094,7 +1094,7 @@ a.external:not(.no-arrow):after, a[href^="http://"]:not(.no-arrow):after, a[href
/* !!! Cannot set overflow: auto, submenus will break !!! */
}
body.mobile #context-menu-container {
body.mobile #context-menu-container.mobile-bottom-menu {
position: fixed !important;
left: 0 !important;
right: 0 !important;