From 2937233ec63c472eb7d108ffcf8d39ee44da8f0b Mon Sep 17 00:00:00 2001 From: sienori Date: Mon, 8 Mar 2021 23:54:34 +0900 Subject: [PATCH] Refactor content/index.js --- src/content/index.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/content/index.js b/src/content/index.js index 2ce2a75..806cff4 100644 --- a/src/content/index.js +++ b/src/content/index.js @@ -27,7 +27,7 @@ const handleMouseUp = async e => { const isInPasswordField = e.target.tagName === "INPUT" && e.target.type === "password"; if (isInPasswordField) return; - const inCodeElement = e.target.tagName === 'CODE' || !!e.target.closest('code'); + const inCodeElement = e.target.tagName === "CODE" || !!e.target.closest("code"); if (inCodeElement && getSettings("isDisabledInCodeElement")) return; const isInThisElement = @@ -37,7 +37,7 @@ const handleMouseUp = async e => { removeTranslatecontainer(); - const ignoredDocumentLang = getSettings('ignoredDocumentLang').split(',').map(s => s.trim()).filter(s => !!s) + const ignoredDocumentLang = getSettings("ignoredDocumentLang").split(",").map(s => s.trim()).filter(s => !!s); if (!!document.documentElement.lang && ignoredDocumentLang.includes(document.documentElement.lang)) return; const selectedText = getSelectedText(); @@ -92,9 +92,9 @@ const getSelectedPosition = () => { const selectedRect = isInTextField ? element.getBoundingClientRect() : window - .getSelection() - .getRangeAt(0) - .getBoundingClientRect(); + .getSelection() + .getRangeAt(0) + .getBoundingClientRect(); let selectedPosition; const panelReferencePoint = getSettings("panelReferencePoint");