mirror of
https://github.com/monkeytypegame/monkeytype.git
synced 2025-03-10 21:53:13 +08:00
some cleanup of Hebrew support
This commit is contained in:
parent
47fe0c6a46
commit
74036d5eb9
2 changed files with 13 additions and 15 deletions
|
@ -1337,6 +1337,14 @@ key {
|
|||
align-content: flex-start;
|
||||
user-select: none;
|
||||
|
||||
/* a little hack for right-to-left languages */
|
||||
&.rightToLeftTest {
|
||||
flex-direction: row-reverse;
|
||||
.word {
|
||||
flex-direction: row-reverse;
|
||||
}
|
||||
}
|
||||
|
||||
&.flipped {
|
||||
.word {
|
||||
color: var(--text-color);
|
||||
|
@ -1522,16 +1530,6 @@ key {
|
|||
opacity: 0 !important;
|
||||
}
|
||||
}
|
||||
|
||||
/* a little hack for right-to-left languages */
|
||||
div.pageTest.rightToLeftTest {
|
||||
#words {
|
||||
flex-direction: row-reverse;
|
||||
.word {
|
||||
flex-direction: row-reverse;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#showWordHistoryButton {
|
||||
|
|
|
@ -554,8 +554,8 @@ function initWords() {
|
|||
wordsList.push(w[i]);
|
||||
}
|
||||
}
|
||||
//special case right-to-left languages.
|
||||
if (config.language == "hebrew") {
|
||||
//special case right-to-left languages (currently only Hebrew)
|
||||
if (config.language === "hebrew") {
|
||||
arrangeCharactersRightToLeft();
|
||||
} else {
|
||||
arrangeCharactersLeftToRight();
|
||||
|
@ -564,11 +564,11 @@ function initWords() {
|
|||
}
|
||||
|
||||
function arrangeCharactersRightToLeft() {
|
||||
$("#middle > div.pageTest").addClass("rightToLeftTest");
|
||||
$("#words").addClass("rightToLeftTest");
|
||||
}
|
||||
|
||||
function arrangeCharactersLeftToRight() {
|
||||
$("#middle > div.pageTest").removeClass("rightToLeftTest");
|
||||
$("#words").removeClass("rightToLeftTest");
|
||||
}
|
||||
|
||||
function setToggleSettings(state) {
|
||||
|
@ -1412,7 +1412,7 @@ function updateCaretPosition() {
|
|||
.querySelectorAll("letter")[currentLetterIndex];
|
||||
|
||||
if ($(currentLetter).length == 0) return;
|
||||
//special case right to left languages
|
||||
//special case right to left languages (currently only Hebrew)
|
||||
const isLeftToRight = config.language !== "hebrew";
|
||||
let currentLetterPosLeft = isLeftToRight
|
||||
? currentLetter.offsetLeft
|
||||
|
|
Loading…
Reference in a new issue