message_edit: Added copy to clipboard button.

A copy-to-clipboard button is added over message-edit textarea.
Closes #3239.
This commit is contained in:
Raghav Jajodia
2017-01-18 01:21:30 +05:30
committed by Tim Abbott
parent 2991c19fea
commit 9707c74f33
10 changed files with 64 additions and 2 deletions

View File

@@ -212,6 +212,25 @@ $(function () {
$('.message_failed i[data-toggle="tooltip"]').tooltip();
$('.copy_message[data-toggle="tooltip"]').tooltip();
$("body").on("mouseover", "#message_edit_content", function () {
$(this).closest(".message_row").find(".copy_message").show();
});
$("body").on("mouseout", "#message_edit_content", function () {
$(this).closest(".message_row").find(".copy_message").hide();
});
$("body").on("mouseover", ".copy_message", function () {
$(this).show();
$(this).tooltip('show');
});
$("body").on("mouseout", ".copy_message", function () {
$(this).tooltip('hide');
});
if (!page_params.realm_allow_message_editing) {
$("#edit-message-hotkey-help").hide();
}