mirror of
				https://github.com/zadam/trilium.git
				synced 2025-10-30 19:19:03 +01: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"; |     orientation?: "left"; | ||||||
|     selectMenuItemHandler: MenuHandler<T>; |     selectMenuItemHandler: MenuHandler<T>; | ||||||
|     items: MenuItem<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 { | interface MenuSeparatorItem { | ||||||
| @ -60,6 +62,7 @@ class ContextMenu { | |||||||
|             await this.hide(); |             await this.hide(); | ||||||
|         } |         } | ||||||
| 
 | 
 | ||||||
|  |         this.$widget.toggleClass("mobile-bottom-menu", !this.options.forcePositionOnMobile); | ||||||
|         this.$cover.addClass("show"); |         this.$cover.addClass("show"); | ||||||
|         $("body").addClass("context-menu-shown"); |         $("body").addClass("context-menu-shown"); | ||||||
| 
 | 
 | ||||||
|  | |||||||
| @ -52,7 +52,8 @@ class MobileDetailMenuWidget extends BasicWidget { | |||||||
|                     } else { |                     } else { | ||||||
|                         throw new Error(t("mobile_detail_menu.error_unrecognized_command", { command })); |                         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 !!! */ |     /* !!! Cannot set overflow: auto, submenus will break !!! */ | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| body.mobile #context-menu-container { | body.mobile #context-menu-container.mobile-bottom-menu { | ||||||
|     position: fixed !important; |     position: fixed !important; | ||||||
|     left: 0 !important; |     left: 0 !important; | ||||||
|     right: 0 !important; |     right: 0 !important; | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user
	 Elian Doran
						Elian Doran