Browse Source

Fix bubble group after last item delete from album

Fix delete whole album by context menu
master
Eduard Kuzmenko 4 years ago
parent
commit
b8e3ce1e4d
  1. 2
      src/components/chat/contextMenu.ts
  2. 11
      src/lib/appManagers/appImManager.ts

2
src/components/chat/contextMenu.ts

@ -295,7 +295,7 @@ export default class ChatContextMenu { @@ -295,7 +295,7 @@ export default class ChatContextMenu {
if(appImManager.chatSelection.isSelecting) {
appImManager.chatSelection.selectionDeleteBtn.click();
} else {
new PopupDeleteMessages([this.msgID]);
new PopupDeleteMessages(this.isTargetAnAlbumItem ? [this.msgID] : appMessagesManager.getMidsByMid(this.msgID));
}
};
}

11
src/lib/appManagers/appImManager.ts

@ -750,7 +750,7 @@ export class AppImManager { @@ -750,7 +750,7 @@ export class AppImManager {
return;
}
if(e.target != this.chatInputC.messageInput && target.tagName != 'INPUT') {
if(e.target != this.chatInputC.messageInput && target.tagName != 'INPUT' && !target.hasAttribute('contenteditable')) {
this.chatInputC.messageInput.focus();
placeCaretAtEnd(this.chatInputC.messageInput);
}
@ -1724,7 +1724,16 @@ export class AppImManager { @@ -1724,7 +1724,16 @@ export class AppImManager {
bubble.classList.add('is-first-unread');
}
// * Нужно очистить прошлую информацию, полезно если удалить последний элемент из альбома в ПОСЛЕДНЕМ БАББЛЕ ГРУППЫ (видно по аватару)
const originalMid = +bubble.dataset.mid;
if(+message.mid != originalMid) {
this.bubbleGroups.removeBubble(bubble, originalMid);
if(!updatePosition) {
this.bubbleGroups.addBubble(bubble, message, reverse);
}
}
delete this.bubbles[originalMid];
//bubble.innerHTML = '';
}

Loading…
Cancel
Save