mirror of
https://github.com/TriliumNext/Notes.git
synced 2025-08-10 10:22:29 +08:00
fix(mobile): position of note detail menu (closes #971)
This commit is contained in:
parent
e3bcd75a5a
commit
7cf1fbf088
@ -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");
|
||||
|
||||
|
@ -52,7 +52,8 @@ class MobileDetailMenuWidget extends BasicWidget {
|
||||
} else {
|
||||
throw new Error(t("mobile_detail_menu.error_unrecognized_command", { command }));
|
||||
}
|
||||
}
|
||||
},
|
||||
forcePositionOnMobile: true
|
||||
});
|
||||
});
|
||||
}
|
||||
|
@ -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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user