mirror of
https://github.com/vector-im/element-web.git
synced 2025-08-24 07:51:34 +02:00
Fix copy button on code blocks when there is no code just pre
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
This commit is contained in:
parent
2b6cbae4a7
commit
90255be499
@ -278,7 +278,7 @@ export default createReactClass({
|
|||||||
const button = document.createElement("span");
|
const button = document.createElement("span");
|
||||||
button.className = "mx_EventTile_copyButton";
|
button.className = "mx_EventTile_copyButton";
|
||||||
button.onclick = (e) => {
|
button.onclick = (e) => {
|
||||||
const copyCode = button.parentNode.getElementsByTagName("code")[0];
|
const copyCode = button.parentNode.getElementsByTagName("pre")[0];
|
||||||
const successful = this.copyToClipboard(copyCode.textContent);
|
const successful = this.copyToClipboard(copyCode.textContent);
|
||||||
|
|
||||||
const buttonRect = e.target.getBoundingClientRect();
|
const buttonRect = e.target.getBoundingClientRect();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user