Skip to content

Commit 213bd2e

Browse files
committed
Fix bolding/reporting errors for side-by-side english view
1 parent 4d9405c commit 213bd2e

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

Diff for: js/ref_selection_snackbar.ts

+6-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,11 @@ const findSefariaRef = (node: Node | null): FindSefariaRefReturnType => {
4444
let highlightId;
4545
while (node?.parentElement) {
4646
const $parentElement = $(node.parentElement);
47-
isEnglish = isEnglish || $parentElement.hasClass("english");
47+
console.log($parentElement);
48+
isEnglish = (
49+
isEnglish
50+
|| $parentElement.hasClass("english")
51+
|| $parentElement.hasClass("english-ref-text"));
4852
const isTranslationOfSourceText = $parentElement.hasClass("translation");
4953
const ref = $parentElement.attr("sefaria-ref");
5054
highlightId ||= $parentElement.attr("highlight-id");
@@ -142,6 +146,7 @@ class SelectionState {
142146
const selection = document.getSelection()!;
143147
this.selectedText = selection.toString().trim() ?? "";
144148
const {isEnglish, hebrew, translation} = this.sefariaRef;
149+
console.log(isEnglish, translation, hebrew);
145150
const entireNodeAndText = isEnglish ? translation : hebrew;
146151
if (entireNodeAndText === undefined) {
147152
throw new Error(`Text is undefined: ${JSON.stringify(this.sefariaRef)}`);

0 commit comments

Comments
 (0)