mirror of
https://github.com/zadam/trilium.git
synced 2025-10-20 15:19:01 +02:00
chore(client/rtl): normalize values between RTL and LTR
This commit is contained in:
parent
b8f0fc722c
commit
13d2721696
@ -87,11 +87,12 @@ export default class SidebarContainer extends FlexContainer<BasicWidget> {
|
|||||||
const width = this.sidebarEl.offsetWidth;
|
const width = this.sidebarEl.offsetWidth;
|
||||||
let translatePercentage = Math.min(0, Math.max(this.currentTranslate + (deltaX / width) * 100, -100));
|
let translatePercentage = Math.min(0, Math.max(this.currentTranslate + (deltaX / width) * 100, -100));
|
||||||
const backdropOpacity = Math.max(0, 1 + translatePercentage / 100);
|
const backdropOpacity = Math.max(0, 1 + translatePercentage / 100);
|
||||||
if (glob.isRtl) {
|
|
||||||
translatePercentage *= -1;
|
|
||||||
}
|
|
||||||
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(backdropOpacity);
|
this.backdropEl.style.opacity = String(backdropOpacity);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user