diff --git a/src/components/appMediaViewer.ts b/src/components/appMediaViewer.ts index c3d0f33f..9790b37b 100644 --- a/src/components/appMediaViewer.ts +++ b/src/components/appMediaViewer.ts @@ -95,7 +95,7 @@ class AppMediaViewerBase { const message = appMessagesManager.getMessage(msgId); - const {dialog, dom} = appDialogsManager.addDialog(message.peerId, this.scrollable/* searchGroup.list */, false); + const {dialog, dom} = appDialogsManager.addDialogNew({ + dialog: message.peerId, + container: this.scrollable/* searchGroup.list */, + drawStatus: false, + avatarSize: 48 + }); appDialogsManager.setLastMessage(dialog, message, dom, query); }); diff --git a/src/components/appSelectPeers.ts b/src/components/appSelectPeers.ts index 066cbfd6..28a75049 100644 --- a/src/components/appSelectPeers.ts +++ b/src/components/appSelectPeers.ts @@ -316,7 +316,13 @@ export default class AppSelectPeers { } peerIds.forEach(peerId => { - const {dom} = appDialogsManager.addDialog(peerId, this.scrollable, false, false); + const {dom} = appDialogsManager.addDialogNew({ + dialog: peerId, + container: this.scrollable, + drawStatus: false, + rippleEnabled: false, + avatarSize: 48 + }); if(this.multiSelect) { const selected = this.selected.has(peerId); @@ -355,6 +361,7 @@ export default class AppSelectPeers { const avatarEl = document.createElement('avatar-element'); avatarEl.classList.add('selector-user-avatar', 'tgico'); avatarEl.setAttribute('dialog', '1'); + avatarEl.classList.add('avatar-32'); div.dataset.key = '' + peerId; if(typeof(peerId) === 'number') { diff --git a/src/components/chat/markupTooltip.ts b/src/components/chat/markupTooltip.ts index 21c6a81d..bf519232 100644 --- a/src/components/chat/markupTooltip.ts +++ b/src/components/chat/markupTooltip.ts @@ -130,6 +130,10 @@ export default class MarkupTooltip { this.wrapper.append(tools1, tools2); this.container.append(this.wrapper); document.body.append(this.container); + + window.addEventListener('resize', () => { + this.hide(); + }); } private applyLink(e: Event) { diff --git a/src/components/chat/topbar.ts b/src/components/chat/topbar.ts index e39a8562..0bd3fbf2 100644 --- a/src/components/chat/topbar.ts +++ b/src/components/chat/topbar.ts @@ -144,6 +144,7 @@ export default class ChatTopbar { this.avatarElement = new AvatarElement(); this.avatarElement.setAttribute('dialog', '1'); this.avatarElement.setAttribute('clickable', ''); + this.avatarElement.classList.add('avatar-40'); this.subtitle = document.createElement('div'); this.subtitle.classList.add('info'); diff --git a/src/components/sidebarLeft/index.ts b/src/components/sidebarLeft/index.ts index d998a3c7..44372566 100644 --- a/src/components/sidebarLeft/index.ts +++ b/src/components/sidebarLeft/index.ts @@ -217,7 +217,13 @@ export class AppSidebarLeft extends SidebarSlider { //console.log('got top categories:', categories); if(peers.length) { peers.forEach((peerId) => { - appDialogsManager.addDialog(peerId, this.searchGroups.people.list, false, true, true); + appDialogsManager.addDialogNew({ + dialog: peerId, + container: this.searchGroups.people.list, + drawStatus: false, + onlyFirstName: true, + avatarSize: 54 + }); }); } @@ -347,7 +353,13 @@ export class AppSidebarLeft extends SidebarSlider { this.recentSearchClearBtn.style.display = this.recentSearch.length ? '' : 'none'; this.recentSearch.slice(0, 20).forEach(peerId => { - let {dialog, dom} = appDialogsManager.addDialog(peerId, this.searchGroups.recent.list, false, true, false, true); + let {dialog, dom} = appDialogsManager.addDialogNew({ + dialog: peerId, + container: this.searchGroups.recent.list, + drawStatus: false, + meAsSaved: true, + avatarSize: 48 + }); dom.lastMessageSpan.innerText = peerId > 0 ? appUsersManager.getUserStatusString(peerId) : appChatsManager.getChatMembersString(peerId); }); diff --git a/src/components/sidebarLeft/tabs/contacts.ts b/src/components/sidebarLeft/tabs/contacts.ts index 5ecc1f36..2f79c37f 100644 --- a/src/components/sidebarLeft/tabs/contacts.ts +++ b/src/components/sidebarLeft/tabs/contacts.ts @@ -90,7 +90,12 @@ export default class AppContactsTab implements SliderTab { let arr = sorted.splice(0, pageCount); // надо splice! arr.forEach(({user}) => { - let {dialog, dom} = appDialogsManager.addDialog(user.id, this.list, false); + let {dialog, dom} = appDialogsManager.addDialogNew({ + dialog: user.id, + container: this.list, + drawStatus: false, + avatarSize: 48 + }); let status = appUsersManager.getUserStatusString(user.id); dom.lastMessageSpan.innerHTML = status == 'online' ? `${status}` : status; diff --git a/src/components/sidebarLeft/tabs/editFolder.ts b/src/components/sidebarLeft/tabs/editFolder.ts index 46f2776e..0c93067e 100644 --- a/src/components/sidebarLeft/tabs/editFolder.ts +++ b/src/components/sidebarLeft/tabs/editFolder.ts @@ -189,7 +189,14 @@ export default class AppEditFolderTab implements SliderTab { for(let i = 0, length = Math.min(peers.length, _length); i < length; ++i) { const peerId = peers.shift(); - const {dom} = appDialogsManager.addDialog(peerId, ul, false, false, undefined, true); + const {dom} = appDialogsManager.addDialogNew({ + dialog: peerId, + container: ul, + drawStatus: false, + rippleEnabled: false, + meAsSaved: true, + avatarSize: 32 + }); dom.lastMessageSpan.parentElement.remove(); } diff --git a/src/components/sidebarLeft/tabs/includedChats.ts b/src/components/sidebarLeft/tabs/includedChats.ts index 88275169..fb288a7b 100644 --- a/src/components/sidebarLeft/tabs/includedChats.ts +++ b/src/components/sidebarLeft/tabs/includedChats.ts @@ -101,7 +101,13 @@ export default class AppIncludedChatsTab implements SliderTab { peerIds.forEach(peerId => { //if(other.includes(peerId)) return; - const {dom} = appDialogsManager.addDialog(peerId, this.selector.scrollable, false, false); + const {dom} = appDialogsManager.addDialogNew({ + dialog: peerId, + container: this.selector.scrollable, + drawStatus: false, + rippleEnabled: false, + avatarSize: 46 + }); const selected = this.selector.selected.has(peerId); dom.containerEl.insertAdjacentHTML('beforeend', this.checkbox(selected)); diff --git a/src/components/sidebarLeft/tabs/newGroup.ts b/src/components/sidebarLeft/tabs/newGroup.ts index cd46ac20..83339d7b 100644 --- a/src/components/sidebarLeft/tabs/newGroup.ts +++ b/src/components/sidebarLeft/tabs/newGroup.ts @@ -75,7 +75,13 @@ export default class AppNewGroupTab implements SliderTab { appSidebarLeft.selectTab(AppSidebarLeft.SLIDERITEMSIDS.newGroup); this.userIds.forEach(userId => { - let {dom} = appDialogsManager.addDialog(userId, this.searchGroup.list, false, false); + let {dom} = appDialogsManager.addDialogNew({ + dialog: userId, + container: this.searchGroup.list, + drawStatus: false, + rippleEnabled: false, + avatarSize: 48 + }); let subtitle = ''; subtitle = appUsersManager.getUserStatusString(userId); diff --git a/src/components/sidebarRight/tabs/pollResults.ts b/src/components/sidebarRight/tabs/pollResults.ts index 93b4dcc0..9c04b9fc 100644 --- a/src/components/sidebarRight/tabs/pollResults.ts +++ b/src/components/sidebarRight/tabs/pollResults.ts @@ -88,7 +88,14 @@ export default class AppPollResultsTab implements SliderTab { appPollsManager.getVotes(mid, answer.option, offset, limit).then(votesList => { votesList.votes.forEach(vote => { - const {dom} = appDialogsManager.addDialog(vote.user_id, list, false, false, undefined, false); + const {dom} = appDialogsManager.addDialogNew({ + dialog: vote.user_id, + container: list, + drawStatus: false, + rippleEnabled: false, + meAsSaved: false, + avatarSize: 32 + }); dom.lastMessageSpan.parentElement.remove(); }); diff --git a/src/index.hbs b/src/index.hbs index 30c27e95..21e94a06 100644 --- a/src/index.hbs +++ b/src/index.hbs @@ -5,7 +5,7 @@ Telegram Web - + @@ -262,7 +262,7 @@