mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-25 16:24:46 +00:00
Fix code examples buttons not appearing on click on mobile
This commit is contained in:
parent
0d634185df
commit
670a78b3a7
@ -1878,9 +1878,15 @@ href="https://doc.rust-lang.org/${channel}/rustdoc/read-documentation/search.htm
|
||||
if (elem === null) {
|
||||
return;
|
||||
}
|
||||
const buttons = elem.querySelector(".button-holder");
|
||||
let buttons = elem.querySelector(".button-holder");
|
||||
if (buttons === null) {
|
||||
return;
|
||||
// On mobile, you can't hover an element so buttons need to be created on click
|
||||
// if they're not already there.
|
||||
addCopyButton(event);
|
||||
buttons = elem.querySelector(".button-holder");
|
||||
if (buttons === null) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
buttons.classList.toggle("keep-visible");
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user