mirror of
				https://github.com/zadam/trilium.git
				synced 2025-10-31 18:36:30 +01:00 
			
		
		
		
	fix(client/rtl): initial drag of mobile tree not working
This commit is contained in:
		| @@ -27,6 +27,7 @@ export default class SidebarContainer extends FlexContainer<BasicWidget> { | |||||||
|     private backdropEl!: HTMLElement; |     private backdropEl!: HTMLElement; | ||||||
|     private originalSidebarTransition: string; |     private originalSidebarTransition: string; | ||||||
|     private originalBackdropTransition: string; |     private originalBackdropTransition: string; | ||||||
|  |     private screenWidth: number; | ||||||
|  |  | ||||||
|     constructor(screenName: Screen, direction: FlexDirection) { |     constructor(screenName: Screen, direction: FlexDirection) { | ||||||
|         super(direction); |         super(direction); | ||||||
| @@ -37,6 +38,7 @@ export default class SidebarContainer extends FlexContainer<BasicWidget> { | |||||||
|         this.dragState = DRAG_STATE_NONE; |         this.dragState = DRAG_STATE_NONE; | ||||||
|         this.originalSidebarTransition = ""; |         this.originalSidebarTransition = ""; | ||||||
|         this.originalBackdropTransition = ""; |         this.originalBackdropTransition = ""; | ||||||
|  |         this.screenWidth = document.body.getBoundingClientRect().width; | ||||||
|     } |     } | ||||||
|  |  | ||||||
|     doRender() { |     doRender() { | ||||||
| @@ -51,7 +53,9 @@ export default class SidebarContainer extends FlexContainer<BasicWidget> { | |||||||
|         const x = "touches" in e ? e.touches[0].clientX : e.clientX; |         const x = "touches" in e ? e.touches[0].clientX : e.clientX; | ||||||
|         this.startX = x; |         this.startX = x; | ||||||
|  |  | ||||||
|         if (x > 30 && this.currentTranslate === -100) { |         // Prevent dragging if too far from the edge of the screen and the menu is closed. | ||||||
|  |         let dragRefX = glob.isRtl ? this.screenWidth - x : x; | ||||||
|  |         if (dragRefX > 30 && this.currentTranslate === -100) { | ||||||
|             return; |             return; | ||||||
|         } |         } | ||||||
|  |  | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user