diff options
| author | binarycat <binarycat@envs.net> | 2025-03-10 13:46:35 -0500 |
|---|---|---|
| committer | binarycat <binarycat@envs.net> | 2025-03-10 15:00:35 -0500 |
| commit | f5efd2aba3003aff5461ce6495558a7dad0a3923 (patch) | |
| tree | 8876ab5255b63790700e6d6031be06b8eb7d1ffd /src | |
| parent | 6622111906f5fd0b2820263a92d23df4aba831a8 (diff) | |
| download | rust-f5efd2aba3003aff5461ce6495558a7dad0a3923.tar.gz rust-f5efd2aba3003aff5461ce6495558a7dad0a3923.zip | |
main.js(isDisplayed): coerce truthy values to boolean
Diffstat (limited to 'src')
| -rw-r--r-- | src/librustdoc/html/static/js/main.js | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/librustdoc/html/static/js/main.js b/src/librustdoc/html/static/js/main.js index 02e4839e8e6..3fdff21e591 100644 --- a/src/librustdoc/html/static/js/main.js +++ b/src/librustdoc/html/static/js/main.js @@ -302,11 +302,10 @@ function preLoadCss(cssUrl) { window.searchState.timeout = null; } }, - // @ts-expect-error isDisplayed: () => { const outputElement = window.searchState.outputElement(); - return outputElement && - outputElement.parentElement && + return !!outputElement && + !!outputElement.parentElement && outputElement.parentElement.id === ALTERNATIVE_DISPLAY_ID; }, // Sets the focus on the search bar at the top of the page |
