This commit is contained in:
SillyLossy
2023-03-24 19:42:44 +02:00
6 changed files with 106 additions and 175 deletions

View File

@ -158,7 +158,14 @@ let is_colab = false;
let is_checked_colab = false;
let is_mes_reload_avatar = false;
let optionsPopper = Popper.createPopper(document.getElementById('options_button'), document.getElementById('options'), {
placement: 'top-start',
modifiers: [
{
name: 'offset',
options: {
offset: [-20, -260],
},
},
],
});
const durationSaveEdit = 200;
@ -3911,34 +3918,8 @@ $(document).ready(function () {
}
$(this).parent().parent().children(".mes_text").empty();
$(this).css("display", "none");
$(this)
.parent()
.children(".mes_edit_done")
.css("display", "inline-block");
$(this).parent().children(".mes_edit_done").css("opacity", 0.0);
$(this)
.parent()
.children(".mes_edit_cancel")
.css("display", "inline-block");
$(this).parent().children(".mes_edit_cancel").css("opacity", 0.0);
$(this)
.parent()
.children(".mes_edit_done")
.transition({
opacity: 1.0,
duration: 600,
easing: "",
complete: function () { },
});
$(this)
.parent()
.children(".mes_edit_cancel")
.transition({
opacity: 1.0,
duration: 600,
easing: "",
complete: function () { },
});
$(this).parent().children(".mes_edit_done").css("display", "inline-block");
$(this).parent().children(".mes_edit_cancel").css("display", "inline-block");
var edit_mes_id = $(this).parent().parent().parent().attr("mesid");
this_edit_mes_id = edit_mes_id;
@ -3965,17 +3946,10 @@ $(document).ready(function () {
.parent()
.children(".mes_text")
.children(".edit_textarea");
edit_textarea.css("opacity", 0.0);
edit_textarea.transition({
opacity: 1.0,
duration: 0,
easing: "",
complete: function () { },
});
edit_textarea.height(0);
edit_textarea.height(edit_textarea[0].scrollHeight);
edit_textarea.focus();
edit_textarea[0].setSelectionRange(
edit_textarea[0].setSelectionRange( //this sets the cursor at the end of the text
edit_textarea.val().length,
edit_textarea.val().length
);