Skip to content

Commit

Permalink
fix issue with highlighted text
Browse files Browse the repository at this point in the history
  • Loading branch information
thesofakillers committed Nov 18, 2019
1 parent f6571ab commit fc8dae7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions GPTrueOrFalse/src/content/content.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ function evaluateSelection() {
// get the selected text
let selection = window.getSelection();
// determine which node is at the bottom of the selection and assign it to the element
if (selection.anchorOffset && !selection.focusOffset) {
if (selection.anchorOffset) {
element = selection.anchorNode.parentNode;
} else if (selection.focusOffset && !selection.anchorOffset) {
} else if (selection.focusOffset) {
element = selection.focusNode.parentNode;
}
// parse the selected text
Expand Down

0 comments on commit fc8dae7

Please sign in to comment.