mirror of
				https://github.com/zadam/trilium.git
				synced 2025-10-30 18:05:55 +01:00 
			
		
		
		
	fix(client/rtl): sidebar not draggable
This commit is contained in:
		| @@ -66,7 +66,7 @@ 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; | ||||||
|         const deltaX = x - this.startX; |         const deltaX = glob.isRtl ? this.startX - x : x - this.startX; | ||||||
|         if (this.dragState === DRAG_STATE_INITIAL_DRAG) { |         if (this.dragState === DRAG_STATE_INITIAL_DRAG) { | ||||||
|             if (this.currentTranslate === -100 ? deltaX > DRAG_CLOSED_START_THRESHOLD : deltaX < -DRAG_OPENED_START_THRESHOLD) { |             if (this.currentTranslate === -100 ? deltaX > DRAG_CLOSED_START_THRESHOLD : deltaX < -DRAG_OPENED_START_THRESHOLD) { | ||||||
|                 /* Disable the transitions since they affect performance, they are going to reenabled once drag ends. */ |                 /* Disable the transitions since they affect performance, they are going to reenabled once drag ends. */ | ||||||
| @@ -87,7 +87,11 @@ export default class SidebarContainer extends FlexContainer<BasicWidget> { | |||||||
|             const width = this.sidebarEl.offsetWidth; |             const width = this.sidebarEl.offsetWidth; | ||||||
|             const translatePercentage = Math.min(0, Math.max(this.currentTranslate + (deltaX / width) * 100, -100)); |             const translatePercentage = Math.min(0, Math.max(this.currentTranslate + (deltaX / width) * 100, -100)); | ||||||
|             this.translatePercentage = translatePercentage; |             this.translatePercentage = translatePercentage; | ||||||
|             this.sidebarEl.style.transform = `translateX(${translatePercentage}%)`; |             if (glob.isRtl) { | ||||||
|  |                 this.sidebarEl.style.transform = `translateX(${-translatePercentage}%)`; | ||||||
|  |             } else { | ||||||
|  |                 this.sidebarEl.style.transform = `translateX(${translatePercentage}%)`; | ||||||
|  |             } | ||||||
|             this.backdropEl.style.opacity = String(Math.max(0, 1 + translatePercentage / 100)); |             this.backdropEl.style.opacity = String(Math.max(0, 1 + translatePercentage / 100)); | ||||||
|         } |         } | ||||||
|  |  | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user