Commit Graph

4 Commits

Author SHA1 Message Date
tushar912 f872c95c65 message_edit: Fix copy paste bug on local-echo/pending message.
Previously, when viewing the source of a locally-echoed (pending)
message, if one tried to copy-paste using the copy button, the
"Copied!" status was displayed but the message was not copied.

This was because as we use message ids with a . in then for locally
echoed messages, which ClipboardJS considered an error (invalid
selector).

To solve this
* Remove the data-clipboard-target attribute of copy button.
* Dynamically set target in ClipboardJS config
  the based on message id using querySelector
  with the message id written with CSS.escape.

Fixes #18053.
2021-04-13 12:57:20 -07:00
Aman Agrawal d5e28eb3e2 copy_message: Use tippy for tooltip. 2021-04-07 17:11:23 -07:00
Sumanth V Rao b0c37713e5 templates: Extract and tweak copy_to_clipboard_svg from both buttons.
Since both the original button svg's have their own individual height
and width, this commit tweaks it to values height=20 and width=16 which
works well for both buttons.
2020-10-08 17:13:50 -07:00
Sumanth V Rao 413df1881e templates: Extract and tweak copy_message_button from message_edit_form.
Small tweak in the extracted text which adds aria-lable to the button.
2020-10-08 17:13:50 -07:00