diff --git a/src/librustdoc/html/static/js/main.js b/src/librustdoc/html/static/js/main.js index cb653d6b8dfde..7a6a32ca4e448 100644 --- a/src/librustdoc/html/static/js/main.js +++ b/src/librustdoc/html/static/js/main.js @@ -35,14 +35,6 @@ function elemIsInParent(elem, parent) { return false; } -function blurHandler(event, parentElem, hideCallback) { - if (!elemIsInParent(document.activeElement, parentElem) && - !elemIsInParent(event.relatedTarget, parentElem) - ) { - hideCallback(); - } -} - window.rootPath = getVar("root-path"); window.currentCrate = getVar("current-crate"); @@ -1045,7 +1037,12 @@ function preLoadCss(cssUrl) { } function helpBlurHandler(event) { - blurHandler(event, getHelpButton(), window.hidePopoverMenus); + const parentElem = getHelpButton(); + if (!elemIsInParent(document.activeElement, parentElem) && + !elemIsInParent(event.relatedTarget, parentElem) + ) { + window.hidePopoverMenus(); + } } function buildHelpMenu() {