Skip to content

Commit

Permalink
修复 #261 在启用消息靠左功能后气泡插入位置错误的问题
Browse files Browse the repository at this point in the history
  • Loading branch information
xiyuesaves committed Jun 16, 2024
1 parent b369d78 commit 77a9952
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/render_modules/observerMessageList.js
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,7 @@ async function singleMessageProcessing(target, msgRecord) {
bubbleInside.appendChild(slotEl);
} else {
slotEl.classList.add("outside-slot");
if (messageEl.querySelector(".message-container--self")) {
if (messageEl.querySelector(".message-container--self") && !options.message.selfMsgToLeft) {
bubbleOutside.insertBefore(slotEl, bubbleOutside.firstChild);
} else {
bubbleOutside.appendChild(slotEl);
Expand All @@ -362,7 +362,7 @@ async function singleMessageProcessing(target, msgRecord) {
}
} else if (bubbleOutside) {
slotEl.classList.add("outside-slot");
if (messageEl.querySelector(".message-container--self")) {
if (messageEl.querySelector(".message-container--self") && !options.message.selfMsgToLeft) {
bubbleOutside.insertBefore(slotEl, bubbleOutside.firstChild);
} else {
bubbleOutside.appendChild(slotEl);
Expand Down Expand Up @@ -405,7 +405,7 @@ async function singleMessageProcessing(target, msgRecord) {
const senderNameEl = messageEl.querySelector(".user-name");
if (options.message.showMsgTimeToSenderName && senderNameEl) {
senderNameEl.classList.add("disabled-send-time");
if (messageEl.querySelector(".message-container--self")) {
if (messageEl.querySelector(".message-container--self") && !options.message.selfMsgToLeft) {
if (messageEl.querySelector(".q-tag")) {
senderNameEl.classList.add("self-and-tag");
senderNameEl.insertAdjacentElement("beforeend", newTimeEl);
Expand Down Expand Up @@ -449,7 +449,7 @@ async function singleMessageProcessing(target, msgRecord) {
}
});
if (slotEl.classList.contains("outside-slot")) {
if (messageEl.querySelector(".message-container--self")) {
if (messageEl.querySelector(".message-container--self") && !options.message.selfMsgToLeft) {
if (slotEl.querySelector(".lite-tools-time")) {
slotEl.classList.add("fix-padding-right");
}
Expand All @@ -462,7 +462,7 @@ async function singleMessageProcessing(target, msgRecord) {
}
} else {
newReplaceEl.classList.add("single");
if (messageEl.querySelector(".message-container--self")) {
if (messageEl.querySelector(".message-container--self") && !options.message.selfMsgToLeft) {
msgEl.insertBefore(newReplaceEl, msgEl.firstChild);
} else {
msgEl.appendChild(newReplaceEl);
Expand Down

0 comments on commit 77a9952

Please sign in to comment.