Merge pull request #1267 from city-unit/feature/ui

Minor Fix: Hide extra buttons when you click away
This commit is contained in:
RossAscends 2023-10-21 11:36:40 +09:00 committed by GitHub
commit b41bf7cf4e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 22 additions and 0 deletions

View File

@ -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"];