mirror of
https://github.com/zulip/zulip.git
synced 2025-11-11 01:16:19 +00:00
alerts: Show Copied! Tippy alerts in message area.
This commit properly displays Tippy Copied! alerts in two cases: 1) On the clipboard icon when copying message source. 2) On the hover controls when copying the link to a message. Fixes #21036.
This commit is contained in:
@@ -33,6 +33,7 @@ import * as resize from "./resize";
|
||||
import * as rows from "./rows";
|
||||
import * as settings_data from "./settings_data";
|
||||
import * as timerender from "./timerender";
|
||||
import {show_copied_confirmation} from "./tippyjs";
|
||||
import * as ui_report from "./ui_report";
|
||||
import * as upload from "./upload";
|
||||
import * as util from "./util";
|
||||
@@ -399,13 +400,15 @@ function create_copy_to_clipboard_handler($row, source, message_id) {
|
||||
});
|
||||
|
||||
clipboard.on("success", () => {
|
||||
end_message_row_edit($row);
|
||||
$row.find(".alert-msg").text($t({defaultMessage: "Copied!"}));
|
||||
$row.find(".alert-msg").css("display", "block");
|
||||
$row.find(".alert-msg").delay(1000).fadeOut(300);
|
||||
if ($(".tooltip").is(":visible")) {
|
||||
$(".tooltip").hide();
|
||||
}
|
||||
// Hide the Tippy and source box after a 600ms delay
|
||||
const tippy_timeout_in_ms = 600;
|
||||
show_copied_confirmation(
|
||||
$row.find(".copy_message")[0],
|
||||
() => {
|
||||
end_message_row_edit($row);
|
||||
},
|
||||
tippy_timeout_in_ms,
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user