diff options
| author | Guillaume Gomez <guillaume.gomez@huawei.com> | 2024-08-30 18:27:11 +0200 |
|---|---|---|
| committer | Guillaume Gomez <guillaume.gomez@huawei.com> | 2024-08-31 00:12:16 +0200 |
| commit | 0d156f223a3fb389f813d8fdb0b588f95b3868aa (patch) | |
| tree | e38d8e0cefb9f8c09dc4faf34a4e808904f88fc7 /src/librustdoc/html/static/js/scrape-examples.js | |
| parent | 0d634185dfddefe09047881175f35c65d68dcff1 (diff) | |
| download | rust-0d156f223a3fb389f813d8fdb0b588f95b3868aa.tar.gz rust-0d156f223a3fb389f813d8fdb0b588f95b3868aa.zip | |
Unify scraped examples with other code examples
Diffstat (limited to 'src/librustdoc/html/static/js/scrape-examples.js')
| -rw-r--r-- | src/librustdoc/html/static/js/scrape-examples.js | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/src/librustdoc/html/static/js/scrape-examples.js b/src/librustdoc/html/static/js/scrape-examples.js index 7a3a9c5f340..709a774892f 100644 --- a/src/librustdoc/html/static/js/scrape-examples.js +++ b/src/librustdoc/html/static/js/scrape-examples.js @@ -24,8 +24,7 @@ const line = Math.max(0, loc[0] - 1); scrollOffset = lines.children[line].offsetTop; } else { - const wrapper = elt.querySelector(".code-wrapper"); - const halfHeight = wrapper.offsetHeight / 2; + const halfHeight = elt.offsetHeight / 2; const offsetTop = lines.children[loc[0]].offsetTop; const lastLine = lines.children[loc[1]]; const offsetBot = lastLine.offsetTop + lastLine.offsetHeight; |
