diff --git a/public/script.js b/public/script.js index a97e2d286..943bb7cc4 100644 --- a/public/script.js +++ b/public/script.js @@ -8069,6 +8069,28 @@ jQuery(async function () { }, 150); }) + $(document).on("click", function (e) { + // Check if the click was outside the relevant elements + if (!$(e.target).closest('.extraMesButtons, .extraMesButtonsHint').length) { + // Transition out the .extraMesButtons first + $('.extraMesButtons').transition({ + opacity: 0, + duration: 150, + easing: 'ease-in-out', + complete: function () { + $(this).hide(); // Hide the .extraMesButtons after the transition + + // Transition the .extraMesButtonsHint back in + $('.extraMesButtonsHint').show().transition({ + opacity: .2, + duration: 150, + easing: 'ease-in-out' + }); + } + }); + } + }); + $(document).on("click", ".mes_edit_cancel", function () { let text = chat[this_edit_mes_id]["mes"];