Skip to content

Commit

Permalink
Closes #14
Browse files Browse the repository at this point in the history
  • Loading branch information
mytlogos committed Dec 9, 2018
1 parent 5a13674 commit b657f8e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
2 changes: 0 additions & 2 deletions content/analyzer.js
Original file line number Diff line number Diff line change
Expand Up @@ -1081,8 +1081,6 @@ function arrayMax(array, comparator = (a, b) => Math.max(a, b)) {
return array.length && array.reduce(comparator);
}

window.addEventListener("unload", () => sendMessage({analyzer: false}, true));

/**
* @typedef {Object} AnalyzeResult
*
Expand Down
9 changes: 8 additions & 1 deletion content/overWatch.js
Original file line number Diff line number Diff line change
Expand Up @@ -417,6 +417,10 @@ const OverWatch = (function () {
popupNode.removeChild(child);
},

get shown() {
return showing;
},

showPopup() {
document.body.appendChild(popupNode);
showing = true;
Expand Down Expand Up @@ -480,6 +484,9 @@ const OverWatch = (function () {
let node = evt.target;
let ignore = node === popup.node;

if (!popup.shown || !selectText) {
return;
}
if (!ignore) {
while (node = node.parentElement) {
if (ignore = node === popup.node) {
Expand All @@ -489,7 +496,7 @@ const OverWatch = (function () {
}

if (!ignore) {
selectText && node.innerText && selectText(node.innerText);
node.innerText && selectText(node.innerText);
selectText = undefined;
popup.fadeOut();
}
Expand Down

0 comments on commit b657f8e

Please sign in to comment.