Chatlist menu footer

This commit is contained in:
morethanwords 2021-04-13 22:48:46 +04:00
parent ba2eed05fe
commit 9f807d9a54
6 changed files with 53 additions and 3 deletions

View File

@ -36,6 +36,7 @@ import findUpClassName from "../../helpers/dom/findUpClassName";
import findUpTag from "../../helpers/dom/findUpTag";
import PeerTitle from "../peerTitle";
import { replaceContent } from "../../helpers/dom";
import App from "../../config/app";
export const LEFT_COLUMN_ACTIVE_CLASSNAME = 'is-left-column-shown';
@ -135,12 +136,34 @@ export class AppSidebarLeft extends SidebarSlider {
})
}, {
icon: 'help',
text: 'SettingsHelp',
text: 'TelegramFeatures',
onClick: () => {
appImManager.openUsername('TelegramTips');
}
}, {
icon: 'help',
text: 'ReportBug',
onClick: () => {
const a = document.createElement('a');
a.target = '_blank';
a.href = 'https://bugs.telegram.org/?tag_ids=40&sort=time';
document.body.append(a);
a.click();
setTimeout(() => {
a.remove();
}, 0);
}
}]);
const btnMenuFooter = document.createElement('div');
btnMenuFooter.classList.add('btn-menu-footer');
const t = document.createElement('span');
t.classList.add('btn-menu-footer-text');
t.innerHTML = 'Telegram WebK alpha ' + App.version;
btnMenuFooter.append(t);
btnMenu.classList.add('has-footer');
btnMenu.append(btnMenuFooter);
btnMenu.classList.add('bottom-right');
this.toolsBtn.append(btnMenu);

View File

@ -224,7 +224,8 @@ class PeerProfileAvatars {
const x = e.pageX;
const clickX = x - rect.left;
if(clickX > (rect.width * SWITCH_ZONE) && clickX < (rect.width - rect.width * SWITCH_ZONE)) {
if((!this.listLoader.previous.length && !this.listLoader.next.length)
|| (clickX > (rect.width * SWITCH_ZONE) && clickX < (rect.width - rect.width * SWITCH_ZONE))) {
const peerId = this.peerId;
const targets: {element: HTMLElement, item: string | Message.messageService}[] = [];

View File

@ -13,7 +13,7 @@ const App = {
id: 1025907,
hash: '452b0359b988148995f22ff0f4229750',
version: '0.4.0',
langPackVersion: '0.1.2',
langPackVersion: '0.1.3',
langPack: 'macos',
langPackCode: 'en',
domains: [] as string[],

View File

@ -90,6 +90,7 @@ const lang = {
"MediaViewer.Context.Download": "Download",
"Profile": "Profile",
"Saved": "Saved",
"ReportBug": "Report Bug",
// * android
"ActionCreateChannel": "Channel created",
@ -390,6 +391,7 @@ const lang = {
"other_value": "%1$d stickers"
},
"HidAccount": "The account was hidden by the user",
"TelegramFeatures": "Telegram Features",
// * macos
"AccountSettings.Filters": "Chat Folders",

View File

@ -261,6 +261,10 @@ export class AppImManager {
}
public getChatSavedPosition(chat: Chat): ChatSavedPosition {
if(!(['chat', 'discussion'] as ChatType[]).includes(chat.type) || !chat.peerId) {
return;
}
const key = chat.peerId + (chat.threadId ? '_' + chat.threadId : '');
return sessionStorage.getFromCache('chatPositions')[key];
}

View File

@ -227,6 +227,26 @@
width: auto !important;
max-width: none !important;
}
&.has-footer {
padding-bottom: 0;
}
&-footer {
height: 2.5rem;
background: var(--background-color-true);
display: flex;
align-items: center;
justify-content: center;
border-bottom-left-radius: inherit;
border-bottom-right-radius: inherit;
font-size: .875rem;
cursor: default;
&-text {
margin-top: -.125rem;
}
}
}
.btn-primary {