copy_code_button: Attach tooltip to body to avoid overlap with parent.

Having tooltip `appendTo` to parent causes it to be trimmed by
the size of parent container if the parent doesn't have enough
size to include the tooltip. To fix this, we append tooltip
to `document.body`.
This commit is contained in:
Aman Agrawal 2021-10-01 07:16:33 +05:30 committed by Tim Abbott
parent acbe7ae7a8
commit 0df7c6f1b0
2 changed files with 2 additions and 2 deletions

View File

@ -178,7 +178,7 @@ export function initialize() {
});
delegate("body", {
target: ".rendered_markdown time",
target: [".rendered_markdown time", ".rendered_markdown .copy_codeblock"],
allowHTML: true,
appendTo: () => document.body,
onHidden(instance) {

View File

@ -1,3 +1,3 @@
<button class="btn pull-left copy_button_base copy_codeblock tippy-zulip-tooltip" data-tippy-content="{{t 'Copy code' }}" aria-label="{{t 'Copy code' }}">
<button class="btn pull-left copy_button_base copy_codeblock" data-tippy-content="{{t 'Copy code' }}" aria-label="{{t 'Copy code' }}">
{{> copy_to_clipboard_svg }}
</button>