mirror of
https://github.com/zadam/trilium.git
synced 2025-10-20 15:19:01 +02:00
fix(client/rtl): initial drag of mobile tree not working
This commit is contained in:
parent
13d2721696
commit
ea3cf8078e
@ -27,6 +27,7 @@ export default class SidebarContainer extends FlexContainer<BasicWidget> {
|
||||
private backdropEl!: HTMLElement;
|
||||
private originalSidebarTransition: string;
|
||||
private originalBackdropTransition: string;
|
||||
private screenWidth: number;
|
||||
|
||||
constructor(screenName: Screen, direction: FlexDirection) {
|
||||
super(direction);
|
||||
@ -37,6 +38,7 @@ export default class SidebarContainer extends FlexContainer<BasicWidget> {
|
||||
this.dragState = DRAG_STATE_NONE;
|
||||
this.originalSidebarTransition = "";
|
||||
this.originalBackdropTransition = "";
|
||||
this.screenWidth = document.body.getBoundingClientRect().width;
|
||||
}
|
||||
|
||||
doRender() {
|
||||
@ -51,7 +53,9 @@ export default class SidebarContainer extends FlexContainer<BasicWidget> {
|
||||
const x = "touches" in e ? e.touches[0].clientX : e.clientX;
|
||||
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;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user