[tor-commits] [pluggable-transports/snowflake-webext] 01/02: change alignment by setting dir attribute

gitolite role git at cupani.torproject.org
Fri Nov 4 17:35:53 UTC 2022


This is an automated email from the git hooks/post-receive script.

cohosh pushed a commit to branch main
in repository pluggable-transports/snowflake-webext.

commit 1d669a6852df74f1049d6de638c783ea033051ab
Author: luciole <luciole at systemli.org>
AuthorDate: Wed Nov 2 13:37:28 2022 +0100

    change alignment by setting dir attribute
---
 static/index.js | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/static/index.js b/static/index.js
index 6861459..02f04a8 100644
--- a/static/index.js
+++ b/static/index.js
@@ -65,9 +65,11 @@ fetch(`./_locales/${gotLang}/website.json`)
 .then((json) => {
   var language = document.getElementById('language-switcher');
   var lang = `${gotLang}`;
-  if ((lang == "ar") || (lang == "fa")) {
-    document.body.setAttribute('style', 'text-align:right');
-  }
+  if (lang == "ar" || lang == "fa" || lang == "he" || lang == "ur") {
+    document.documentElement.dir = "rtl";
+  } else {
+    document.documentElement.dir = "ltr";
+  } 
   language.innerText = `${availableLangs.get(lang)} (${lang})`;
   var messages = new Messages(json);
   fill(document.body, (m) => {

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the tor-commits mailing list