From b0f6c41f5dc7f498f2948f846dd273bcb1bc1f0b Mon Sep 17 00:00:00 2001 From: toasted-nutbread Date: Mon, 27 Sep 2021 19:07:28 -0400 Subject: Search query offset value (#1968) * Add type property to TextSource* classes * Use type property rather than instanceof * Expose a sentence offset value * Use offset added to URL * Improve fallback sentence for Anki note context --- ext/js/app/frontend.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'ext/js/app') diff --git a/ext/js/app/frontend.js b/ext/js/app/frontend.js index ef53cecb..0d358639 100644 --- a/ext/js/app/frontend.js +++ b/ext/js/app/frontend.js @@ -18,7 +18,6 @@ /* global * DocumentUtil * TextScanner - * TextSourceElement * TextSourceRange */ @@ -536,7 +535,7 @@ class Frontend { } } }; - if (textSource instanceof TextSourceElement && textSource.fullContent !== query) { + if (textSource.type === 'element' && textSource.fullContent !== query) { details.params.full = textSource.fullContent; details.params['full-visible'] = 'true'; } -- cgit v1.2.3