From 37a63038002cd61a2710b1e8f54c63f8dc887ddb Mon Sep 17 00:00:00 2001 From: Hadi Charara Date: Fri, 8 Jul 2022 13:25:59 -0400 Subject: [PATCH] Final commit --- src/assets/css/librarybrowser.scss | 43 +++++++++++-------- .../emby-scrollbuttons/emby-scrollbuttons.js | 1 - src/libraries/scroller.js | 1 - src/scripts/globalize.js | 3 ++ src/styles/rtl.scss | 22 ---------- 5 files changed, 29 insertions(+), 41 deletions(-) diff --git a/src/assets/css/librarybrowser.scss b/src/assets/css/librarybrowser.scss index 3426f6b766..aa46f18f86 100644 --- a/src/assets/css/librarybrowser.scss +++ b/src/assets/css/librarybrowser.scss @@ -308,6 +308,11 @@ box-shadow: none !important; width: 20.205em !important; font-size: 94%; + + [dir="rtl"] & { + left: unset !important; + right: 0 !important; + } } .dashboardDocument .mainDrawer-scrollContainer { @@ -316,6 +321,11 @@ .dashboardDocument .skinBody { left: 20em; + + [dir="rtl"] & { + left: 0 !important; + right: 20em !important; + } } } @@ -672,6 +682,15 @@ margin-bottom: 0; padding-left: 0; } + + [dir="rtl"] & { + padding-left: unset !important; + @include header-poster-padding-rtl; + + @media all and (max-width: 32em) { + padding-right: 0 !important; + } + } } .subtitle { @@ -696,24 +715,24 @@ .layout-mobile & { display: block; position: relative; - padding: 0.5rem 5%; + padding: 0.5rem 5% !important; } .layout-desktop & { position: relative; - padding-left: 32.45vw; + padding-left: 32.45vw !important; } .layout-tv & { display: block; - padding-left: 32.45vw; + padding-left: 32.45vw !important; } [dir="rtl"] & { .layout-desktop &, .layout-tv & { - padding-right: 32.45vw; - padding-left: unset; + padding-right: 32.45vw !important; + padding-left: unset !important; } } } @@ -1228,21 +1247,11 @@ div:not(.sectionTitleContainer-cards) > .sectionTitle-cards { } .padded-left { - padding-left: 3.3%; - - [dir="rtl"] & { - padding-left: unset; - padding-right: 3.3%; - } + padding-inline-start: 3.3%; } .padded-right { - padding-right: 3.3%; - - [dir="rtl"] & { - padding-right: unset; - padding-left: 3.3%; - } + padding-inline-end: 3.3%; } .padded-top { diff --git a/src/elements/emby-scrollbuttons/emby-scrollbuttons.js b/src/elements/emby-scrollbuttons/emby-scrollbuttons.js index cd276e40ad..f92c05ae52 100644 --- a/src/elements/emby-scrollbuttons/emby-scrollbuttons.js +++ b/src/elements/emby-scrollbuttons/emby-scrollbuttons.js @@ -145,7 +145,6 @@ const EmbyScrollButtonsPrototype = Object.create(HTMLDivElement.prototype); } else if (globalize.getIsRTL()) { newPos = Math.min(0, scrollPos - scrollSize); } - console.log(newPos); scroller.scrollToPosition(newPos, false); } diff --git a/src/libraries/scroller.js b/src/libraries/scroller.js index 4fa5e6de70..7d906c6498 100644 --- a/src/libraries/scroller.js +++ b/src/libraries/scroller.js @@ -61,7 +61,6 @@ function within(number, num1, num2) { } const min = Math.min(num1, num2); const max = Math.max(num1, num2); - console.log(min, max); if (number < min) { return min; } else if (number > max) { diff --git a/src/scripts/globalize.js b/src/scripts/globalize.js index 01e622f00f..af51255a71 100644 --- a/src/scripts/globalize.js +++ b/src/scripts/globalize.js @@ -45,6 +45,7 @@ import { currentSettings as userSettings } from './settings/userSettings'; } function checkAndProcessDir(culture) { + isRTL = false; for (const lang of RTL_LANGS) { if (culture.includes(lang)) { isRTL = true; @@ -60,11 +61,13 @@ import { currentSettings as userSettings } from './settings/userSettings'; function processIsRTL() { document.getElementsByTagName('body')[0].setAttribute('dir', 'rtl'); + document.getElementsByTagName('html')[0].setAttribute('dir', 'rtl'); import('../styles/rtl.scss'); } function processIsLTR() { document.getElementsByTagName('body')[0].setAttribute('dir', 'ltr'); + document.getElementsByTagName('html')[0].setAttribute('dir', 'ltr'); } export function getElementIsRTL(element) { diff --git a/src/styles/rtl.scss b/src/styles/rtl.scss index 4e691719ec..61d06b2a2c 100644 --- a/src/styles/rtl.scss +++ b/src/styles/rtl.scss @@ -18,25 +18,3 @@ transform: scale(-1, 1); } } - -@media all and (min-width: 40em) { - .dashboardDocument .mainDrawer { - left: unset !important; - right: 0 !important; - } - - .dashboardDocument .skinBody { - left: 0 !important; - right: 20em !important; - } -} - -.layout-mobile .mainDetailButtons { - padding-left: unset !important; - @include header-poster-padding-rtl; - - @media all and (max-width: 32em) { - padding-left: unset !important; - padding-right: 0 Im !important; - } -}