mirror of
https://github.com/vector-im/element-web.git
synced 2026-05-05 04:06:44 +02:00
Revert "Don't show copy button if there is no <code>"
This reverts commit c76cc33ebfc4e501e0322c3d70ca88770c70bbc4.
This commit is contained in:
parent
c76cc33ebf
commit
87a2454556
@ -161,9 +161,6 @@ export default class TextualBody extends React.Component {
|
||||
}
|
||||
|
||||
_addCodeCopyButton(div) {
|
||||
const copyCode = div.getElementsByTagName("code")[0];
|
||||
// If there isn't any code element don't show the copy button
|
||||
if (!copyCode) return;
|
||||
const button = document.createElement("span");
|
||||
button.className = "mx_EventTile_button mx_EventTile_copyButton ";
|
||||
|
||||
@ -173,6 +170,7 @@ export default class TextualBody extends React.Component {
|
||||
if (expansionButtonExists.length > 0) button.className += "mx_EventTile_buttonBottom";
|
||||
|
||||
button.onclick = async () => {
|
||||
const copyCode = button.parentNode.getElementsByTagName("code")[0];
|
||||
const successful = await copyPlaintext(copyCode.textContent);
|
||||
|
||||
const buttonRect = button.getBoundingClientRect();
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user