Refactor search & sticker tabs
This commit is contained in:
parent
5c19c72680
commit
0df25557e0
@ -28,6 +28,7 @@ import { REPLIES_PEER_ID } from "../../lib/mtproto/mtproto_config";
|
|||||||
import { renderImageFromUrl } from "../misc";
|
import { renderImageFromUrl } from "../misc";
|
||||||
import SetTransition from "../singleTransition";
|
import SetTransition from "../singleTransition";
|
||||||
import { fastRaf } from "../../helpers/schedulers";
|
import { fastRaf } from "../../helpers/schedulers";
|
||||||
|
import AppPrivateSearchTab from "../sidebarRight/tabs/search";
|
||||||
|
|
||||||
export type ChatType = 'chat' | 'pinned' | 'replies' | 'discussion' | 'scheduled';
|
export type ChatType = 'chat' | 'pinned' | 'replies' | 'discussion' | 'scheduled';
|
||||||
|
|
||||||
@ -201,8 +202,9 @@ export default class Chat extends EventListenerBase<{
|
|||||||
|
|
||||||
// set new
|
// set new
|
||||||
if(!samePeer) {
|
if(!samePeer) {
|
||||||
if(appSidebarRight.historyTabIds[appSidebarRight.historyTabIds.length - 1] === AppSidebarRight.SLIDERITEMSIDS.search) {
|
const searchTab = appSidebarRight.getTab(AppPrivateSearchTab);
|
||||||
appSidebarRight.onCloseBtnClick();
|
if(searchTab) {
|
||||||
|
searchTab.close();
|
||||||
}
|
}
|
||||||
|
|
||||||
appSidebarRight.sharedMediaTab.setPeer(peerId, this.threadId);
|
appSidebarRight.sharedMediaTab.setPeer(peerId, this.threadId);
|
||||||
|
@ -21,6 +21,8 @@ import appStateManager from "../../lib/appManagers/appStateManager";
|
|||||||
import PopupDeleteDialog from "../popups/deleteDialog";
|
import PopupDeleteDialog from "../popups/deleteDialog";
|
||||||
import appNavigationController from "../appNavigationController";
|
import appNavigationController from "../appNavigationController";
|
||||||
import { LEFT_COLUMN_ACTIVE_CLASSNAME } from "../sidebarLeft";
|
import { LEFT_COLUMN_ACTIVE_CLASSNAME } from "../sidebarLeft";
|
||||||
|
import AppPrivateSearchTab from "../sidebarRight/tabs/search";
|
||||||
|
import { SliderSuperTab } from "../slider";
|
||||||
|
|
||||||
export default class ChatTopbar {
|
export default class ChatTopbar {
|
||||||
container: HTMLDivElement;
|
container: HTMLDivElement;
|
||||||
@ -226,7 +228,12 @@ export default class ChatTopbar {
|
|||||||
attachClickEvent(this.btnSearch, (e) => {
|
attachClickEvent(this.btnSearch, (e) => {
|
||||||
cancelEvent(e);
|
cancelEvent(e);
|
||||||
if(this.peerId) {
|
if(this.peerId) {
|
||||||
this.appSidebarRight.searchTab.open(this.peerId, this.chat.threadId);
|
let tab = this.appSidebarRight.getTab(AppPrivateSearchTab);
|
||||||
|
if(!tab) {
|
||||||
|
tab = new AppPrivateSearchTab(this.appSidebarRight);
|
||||||
|
}
|
||||||
|
|
||||||
|
tab.open(this.peerId, this.chat.threadId);
|
||||||
}
|
}
|
||||||
}, {listenerSetter: this.listenerSetter});
|
}, {listenerSetter: this.listenerSetter});
|
||||||
}
|
}
|
||||||
|
@ -15,6 +15,7 @@ import StickersTab from "./tabs/stickers";
|
|||||||
import { pause } from "../../helpers/schedulers";
|
import { pause } from "../../helpers/schedulers";
|
||||||
import { MOUNT_CLASS_TO } from "../../config/debug";
|
import { MOUNT_CLASS_TO } from "../../config/debug";
|
||||||
import AppGifsTab from "../sidebarRight/tabs/gifs";
|
import AppGifsTab from "../sidebarRight/tabs/gifs";
|
||||||
|
import AppStickersTab from "../sidebarRight/tabs/stickers";
|
||||||
|
|
||||||
export const EMOTICONSSTICKERGROUP = 'emoticons-dropdown';
|
export const EMOTICONSSTICKERGROUP = 'emoticons-dropdown';
|
||||||
|
|
||||||
@ -132,10 +133,14 @@ export class EmoticonsDropdown {
|
|||||||
this.searchButton = this.element.querySelector('.emoji-tabs-search');
|
this.searchButton = this.element.querySelector('.emoji-tabs-search');
|
||||||
this.searchButton.addEventListener('click', () => {
|
this.searchButton.addEventListener('click', () => {
|
||||||
if(this.tabId === 1) {
|
if(this.tabId === 1) {
|
||||||
appSidebarRight.stickersTab.init();
|
if(!appSidebarRight.isTabExists(AppStickersTab)) {
|
||||||
|
new AppStickersTab(appSidebarRight).open();
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
|
if(!appSidebarRight.isTabExists(AppGifsTab)) {
|
||||||
new AppGifsTab(appSidebarRight).open();
|
new AppGifsTab(appSidebarRight).open();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
this.deleteBtn = this.element.querySelector('.emoji-tabs-delete');
|
this.deleteBtn = this.element.querySelector('.emoji-tabs-delete');
|
||||||
|
@ -8,6 +8,7 @@ import rootScope from "../lib/rootScope";
|
|||||||
import { attachClickEvent, cancelEvent, detachClickEvent, findUpClassName } from "../helpers/dom";
|
import { attachClickEvent, cancelEvent, detachClickEvent, findUpClassName } from "../helpers/dom";
|
||||||
import { ripple } from "./ripple";
|
import { ripple } from "./ripple";
|
||||||
import appSidebarRight from "./sidebarRight";
|
import appSidebarRight from "./sidebarRight";
|
||||||
|
import AppPollResultsTab from "./sidebarRight/tabs/pollResults";
|
||||||
|
|
||||||
let lineTotalLength = 0;
|
let lineTotalLength = 0;
|
||||||
const tailLength = 9;
|
const tailLength = 9;
|
||||||
@ -337,7 +338,10 @@ export default class PollElement extends HTMLElement {
|
|||||||
|
|
||||||
this.viewResults.addEventListener('click', (e) => {
|
this.viewResults.addEventListener('click', (e) => {
|
||||||
cancelEvent(e);
|
cancelEvent(e);
|
||||||
appSidebarRight.pollResultsTab.init(this.message);
|
|
||||||
|
if(!appSidebarRight.isTabExists(AppPollResultsTab)) {
|
||||||
|
new AppPollResultsTab(appSidebarRight).open(this.message);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
ripple(this.viewResults);
|
ripple(this.viewResults);
|
||||||
|
|
||||||
|
@ -1,50 +1,31 @@
|
|||||||
import appImManager from "../../lib/appManagers/appImManager";
|
import appImManager from "../../lib/appManagers/appImManager";
|
||||||
import SidebarSlider from "../slider";
|
import SidebarSlider from "../slider";
|
||||||
import AppStickersTab from "./tabs/stickers";
|
|
||||||
import AppPollResultsTab from "./tabs/pollResults";
|
|
||||||
import AppGifsTab from "./tabs/gifs";
|
|
||||||
import mediaSizes, { ScreenSize } from "../../helpers/mediaSizes";
|
import mediaSizes, { ScreenSize } from "../../helpers/mediaSizes";
|
||||||
import AppPrivateSearchTab from "./tabs/search";
|
|
||||||
import AppSharedMediaTab from "./tabs/sharedMedia";
|
import AppSharedMediaTab from "./tabs/sharedMedia";
|
||||||
import { MOUNT_CLASS_TO } from "../../config/debug";
|
import { MOUNT_CLASS_TO } from "../../config/debug";
|
||||||
|
|
||||||
export const RIGHT_COLUMN_ACTIVE_CLASSNAME = 'is-right-column-shown';
|
export const RIGHT_COLUMN_ACTIVE_CLASSNAME = 'is-right-column-shown';
|
||||||
|
|
||||||
const sharedMediaTab = new AppSharedMediaTab();
|
const sharedMediaTab = new AppSharedMediaTab();
|
||||||
const searchTab = new AppPrivateSearchTab();
|
|
||||||
const stickersTab = new AppStickersTab();
|
|
||||||
const pollResultsTab = new AppPollResultsTab();
|
|
||||||
|
|
||||||
export class AppSidebarRight extends SidebarSlider {
|
export class AppSidebarRight extends SidebarSlider {
|
||||||
public static SLIDERITEMSIDS = {
|
public static SLIDERITEMSIDS = {
|
||||||
sharedMedia: 0,
|
sharedMedia: 0,
|
||||||
search: 1,
|
|
||||||
stickers: 2,
|
|
||||||
pollResults: 3
|
|
||||||
};
|
};
|
||||||
|
|
||||||
public sharedMediaTab: AppSharedMediaTab;
|
public sharedMediaTab: AppSharedMediaTab;
|
||||||
public searchTab: AppPrivateSearchTab;
|
|
||||||
public stickersTab: AppStickersTab;
|
|
||||||
public pollResultsTab: AppPollResultsTab;
|
|
||||||
|
|
||||||
constructor() {
|
constructor() {
|
||||||
super({
|
super({
|
||||||
sidebarEl: document.getElementById('column-right') as HTMLElement,
|
sidebarEl: document.getElementById('column-right') as HTMLElement,
|
||||||
tabs: new Map([
|
tabs: new Map([
|
||||||
[AppSidebarRight.SLIDERITEMSIDS.sharedMedia, sharedMediaTab],
|
[AppSidebarRight.SLIDERITEMSIDS.sharedMedia, sharedMediaTab],
|
||||||
[AppSidebarRight.SLIDERITEMSIDS.search, searchTab],
|
|
||||||
[AppSidebarRight.SLIDERITEMSIDS.stickers, stickersTab],
|
|
||||||
[AppSidebarRight.SLIDERITEMSIDS.pollResults, pollResultsTab]
|
|
||||||
] as any[]),
|
] as any[]),
|
||||||
canHideFirst: true,
|
canHideFirst: true,
|
||||||
navigationType: 'right'
|
navigationType: 'right'
|
||||||
});
|
});
|
||||||
|
|
||||||
this.sharedMediaTab = sharedMediaTab;
|
this.sharedMediaTab = sharedMediaTab;
|
||||||
this.searchTab = searchTab;
|
|
||||||
this.stickersTab = stickersTab;
|
|
||||||
this.pollResultsTab = pollResultsTab;
|
|
||||||
|
|
||||||
mediaSizes.addListener('changeScreen', (from, to) => {
|
mediaSizes.addListener('changeScreen', (from, to) => {
|
||||||
if(to === ScreenSize.medium && from !== ScreenSize.mobile) {
|
if(to === ScreenSize.medium && from !== ScreenSize.mobile) {
|
||||||
|
@ -77,7 +77,8 @@ export default class AppGifsTab extends SliderSuperTab {
|
|||||||
this.masonry.lazyLoadQueue.clear();
|
this.masonry.lazyLoadQueue.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected onOpen() {
|
public open() {
|
||||||
|
const ret = super.open();
|
||||||
appSidebarRight.toggleSidebar(true).then(() => {
|
appSidebarRight.toggleSidebar(true).then(() => {
|
||||||
this.search('', true);
|
this.search('', true);
|
||||||
|
|
||||||
@ -85,6 +86,7 @@ export default class AppGifsTab extends SliderSuperTab {
|
|||||||
this.search(this.inputSearch.value, false);
|
this.search(this.inputSearch.value, false);
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
public async search(query: string, newSearch = true) {
|
public async search(query: string, newSearch = true) {
|
||||||
|
@ -1,43 +1,27 @@
|
|||||||
import { SliderTab } from "../../slider";
|
import { SliderSuperTab } from "../../slider";
|
||||||
import Scrollable from "../../scrollable";
|
import appSidebarRight from "..";
|
||||||
import appSidebarRight, { AppSidebarRight } from "..";
|
|
||||||
import appPollsManager from "../../../lib/appManagers/appPollsManager";
|
import appPollsManager from "../../../lib/appManagers/appPollsManager";
|
||||||
import { roundPercents } from "../../poll";
|
import { roundPercents } from "../../poll";
|
||||||
import { RichTextProcessor } from "../../../lib/richtextprocessor";
|
import { RichTextProcessor } from "../../../lib/richtextprocessor";
|
||||||
import appDialogsManager from "../../../lib/appManagers/appDialogsManager";
|
import appDialogsManager from "../../../lib/appManagers/appDialogsManager";
|
||||||
import { ripple } from "../../ripple";
|
import { ripple } from "../../ripple";
|
||||||
|
|
||||||
export default class AppPollResultsTab implements SliderTab {
|
export default class AppPollResultsTab extends SliderSuperTab {
|
||||||
private container = document.getElementById('poll-results-container') as HTMLDivElement;
|
private resultsDiv: HTMLElement;
|
||||||
private contentDiv = this.container.querySelector('.sidebar-content') as HTMLDivElement;
|
|
||||||
private closeBtn = this.container.querySelector('.sidebar-close-button') as HTMLButtonElement;
|
|
||||||
private resultsDiv = this.contentDiv.firstElementChild as HTMLDivElement;
|
|
||||||
private scrollable: Scrollable;
|
|
||||||
|
|
||||||
private message: any;
|
protected init() {
|
||||||
|
this.container.id = 'poll-results-container';
|
||||||
|
this.container.classList.add('chatlist-container');
|
||||||
|
|
||||||
constructor() {
|
this.title.innerHTML = 'Results';
|
||||||
this.scrollable = new Scrollable(this.contentDiv, 'POLL-RESULTS');
|
|
||||||
|
this.resultsDiv = document.createElement('div');
|
||||||
|
this.resultsDiv.classList.add('poll-results');
|
||||||
|
this.scrollable.append(this.resultsDiv);
|
||||||
}
|
}
|
||||||
|
|
||||||
public cleanup() {
|
public open(message: any) {
|
||||||
this.resultsDiv.innerHTML = '';
|
const ret = super.open();
|
||||||
this.message = undefined;
|
|
||||||
}
|
|
||||||
|
|
||||||
public onCloseAfterTimeout() {
|
|
||||||
this.cleanup();
|
|
||||||
}
|
|
||||||
|
|
||||||
public init(message: any) {
|
|
||||||
if(this.message === message) return;
|
|
||||||
|
|
||||||
this.cleanup();
|
|
||||||
|
|
||||||
this.message = message;
|
|
||||||
|
|
||||||
appSidebarRight.selectTab(AppSidebarRight.SLIDERITEMSIDS.pollResults);
|
|
||||||
|
|
||||||
const poll = appPollsManager.getPoll(message.media.poll.id);
|
const poll = appPollsManager.getPoll(message.media.poll.id);
|
||||||
|
|
||||||
const title = document.createElement('h3');
|
const title = document.createElement('h3');
|
||||||
@ -133,5 +117,7 @@ export default class AppPollResultsTab implements SliderTab {
|
|||||||
console.log('gOt VotEs', votes);
|
console.log('gOt VotEs', votes);
|
||||||
}); */
|
}); */
|
||||||
});
|
});
|
||||||
|
|
||||||
|
return ret;
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -1,12 +1,9 @@
|
|||||||
import appSidebarRight, { AppSidebarRight } from "..";
|
import appSidebarRight, { AppSidebarRight } from "..";
|
||||||
import AppSearch, { SearchGroup } from "../../appSearch";
|
import AppSearch, { SearchGroup } from "../../appSearch";
|
||||||
import InputSearch from "../../inputSearch";
|
import InputSearch from "../../inputSearch";
|
||||||
import { SliderTab } from "../../slider";
|
import { SliderSuperTab } from "../../slider";
|
||||||
|
|
||||||
export default class AppPrivateSearchTab implements SliderTab {
|
|
||||||
public container: HTMLElement;
|
|
||||||
public closeBtn: HTMLElement;
|
|
||||||
|
|
||||||
|
export default class AppPrivateSearchTab extends SliderSuperTab {
|
||||||
private inputSearch: InputSearch;
|
private inputSearch: InputSearch;
|
||||||
private appSearch: AppSearch;
|
private appSearch: AppSearch;
|
||||||
|
|
||||||
@ -17,23 +14,22 @@ export default class AppPrivateSearchTab implements SliderTab {
|
|||||||
this.appSearch.beginSearch(this.peerId, this.threadId);
|
this.appSearch.beginSearch(this.peerId, this.threadId);
|
||||||
}
|
}
|
||||||
|
|
||||||
onCloseAfterTimeout() {
|
protected init() {
|
||||||
this.peerId = 0;
|
this.container.id = 'search-private-container';
|
||||||
this.threadId = 0;
|
this.container.classList.add('chatlist-container');
|
||||||
this.appSearch.reset();
|
|
||||||
}
|
|
||||||
|
|
||||||
public init() {
|
|
||||||
this.container = document.getElementById('search-private-container');
|
|
||||||
this.closeBtn = this.container.querySelector('.sidebar-close-button');
|
|
||||||
this.inputSearch = new InputSearch('Search');
|
this.inputSearch = new InputSearch('Search');
|
||||||
this.closeBtn.parentElement.append(this.inputSearch.container);
|
this.title.replaceWith(this.inputSearch.container);
|
||||||
this.appSearch = new AppSearch(this.container.querySelector('.chatlist-container'), this.inputSearch, {
|
|
||||||
|
const c = document.createElement('div');
|
||||||
|
c.classList.add('chatlist-container');
|
||||||
|
this.scrollable.container.replaceWith(c);
|
||||||
|
this.appSearch = new AppSearch(c, this.inputSearch, {
|
||||||
messages: new SearchGroup('Private Search', 'messages')
|
messages: new SearchGroup('Private Search', 'messages')
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
open(peerId: number, threadId?: number) {
|
open(peerId: number, threadId?: number) {
|
||||||
|
const ret = super.open();
|
||||||
if(this.init) {
|
if(this.init) {
|
||||||
this.init();
|
this.init();
|
||||||
this.init = null;
|
this.init = null;
|
||||||
@ -41,13 +37,13 @@ export default class AppPrivateSearchTab implements SliderTab {
|
|||||||
|
|
||||||
if(this.peerId !== 0) {
|
if(this.peerId !== 0) {
|
||||||
this.appSearch.beginSearch(this.peerId, this.threadId);
|
this.appSearch.beginSearch(this.peerId, this.threadId);
|
||||||
return;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
this.peerId = peerId;
|
this.peerId = peerId;
|
||||||
this.threadId = threadId;
|
this.threadId = threadId;
|
||||||
|
|
||||||
appSidebarRight.selectTab(AppSidebarRight.SLIDERITEMSIDS.search);
|
|
||||||
appSidebarRight.toggleSidebar(true);
|
appSidebarRight.toggleSidebar(true);
|
||||||
|
return ret;
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -1,29 +1,24 @@
|
|||||||
import { SliderTab } from "../../slider";
|
import { SliderSuperTab } from "../../slider";
|
||||||
import InputSearch from "../../inputSearch";
|
import InputSearch from "../../inputSearch";
|
||||||
import Scrollable from "../../scrollable";
|
|
||||||
import LazyLoadQueue from "../../lazyLoadQueue";
|
import LazyLoadQueue from "../../lazyLoadQueue";
|
||||||
import { findUpClassName } from "../../../helpers/dom";
|
import { findUpClassName, attachClickEvent } from "../../../helpers/dom";
|
||||||
import appImManager from "../../../lib/appManagers/appImManager";
|
import appImManager from "../../../lib/appManagers/appImManager";
|
||||||
import appStickersManager from "../../../lib/appManagers/appStickersManager";
|
import appStickersManager from "../../../lib/appManagers/appStickersManager";
|
||||||
import PopupStickers from "../../popups/stickers";
|
import PopupStickers from "../../popups/stickers";
|
||||||
import animationIntersector from "../../animationIntersector";
|
import animationIntersector from "../../animationIntersector";
|
||||||
import { RichTextProcessor } from "../../../lib/richtextprocessor";
|
import { RichTextProcessor } from "../../../lib/richtextprocessor";
|
||||||
import { wrapSticker } from "../../wrappers";
|
import { wrapSticker } from "../../wrappers";
|
||||||
import appSidebarRight, { AppSidebarRight } from "..";
|
import appSidebarRight from "..";
|
||||||
import { StickerSet, StickerSetCovered } from "../../../layer";
|
import { StickerSet, StickerSetCovered } from "../../../layer";
|
||||||
|
|
||||||
export default class AppStickersTab implements SliderTab {
|
export default class AppStickersTab extends SliderSuperTab {
|
||||||
private container = document.getElementById('stickers-container') as HTMLDivElement;
|
|
||||||
private contentDiv = this.container.querySelector('.sidebar-content') as HTMLDivElement;
|
|
||||||
private backBtn = this.container.querySelector('.sidebar-close-button') as HTMLButtonElement;
|
|
||||||
//private input = this.container.querySelector('#stickers-search') as HTMLInputElement;
|
|
||||||
private inputSearch: InputSearch;
|
private inputSearch: InputSearch;
|
||||||
private setsDiv = this.contentDiv.firstElementChild as HTMLDivElement;
|
private setsDiv: HTMLDivElement;
|
||||||
private scrollable: Scrollable;
|
|
||||||
private lazyLoadQueue: LazyLoadQueue;
|
private lazyLoadQueue: LazyLoadQueue;
|
||||||
|
|
||||||
constructor() {
|
protected init() {
|
||||||
this.scrollable = new Scrollable(this.contentDiv, 'STICKERS-SEARCH');
|
this.container.id = 'stickers-container';
|
||||||
|
this.container.classList.add('chatlist-container');
|
||||||
|
|
||||||
this.lazyLoadQueue = new LazyLoadQueue();
|
this.lazyLoadQueue = new LazyLoadQueue();
|
||||||
|
|
||||||
@ -31,9 +26,13 @@ export default class AppStickersTab implements SliderTab {
|
|||||||
this.search(value);
|
this.search(value);
|
||||||
});
|
});
|
||||||
|
|
||||||
this.backBtn.parentElement.append(this.inputSearch.container);
|
this.title.replaceWith(this.inputSearch.container);
|
||||||
|
|
||||||
this.setsDiv.addEventListener('click', (e) => {
|
this.setsDiv = document.createElement('div');
|
||||||
|
this.setsDiv.classList.add('sticker-sets');
|
||||||
|
this.scrollable.append(this.setsDiv);
|
||||||
|
|
||||||
|
attachClickEvent(this.setsDiv, (e) => {
|
||||||
const sticker = findUpClassName(e.target, 'sticker-set-sticker');
|
const sticker = findUpClassName(e.target, 'sticker-set-sticker');
|
||||||
if(sticker) {
|
if(sticker) {
|
||||||
const docId = sticker.dataset.docId;
|
const docId = sticker.dataset.docId;
|
||||||
@ -70,13 +69,13 @@ export default class AppStickersTab implements SliderTab {
|
|||||||
new PopupStickers(full.set).show();
|
new PopupStickers(full.set).show();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
}, {listenerSetter: this.listenerSetter});
|
||||||
}
|
}
|
||||||
|
|
||||||
public onCloseAfterTimeout() {
|
public onCloseAfterTimeout() {
|
||||||
this.setsDiv.innerHTML = '';
|
this.setsDiv.innerHTML = '';
|
||||||
this.inputSearch.value = '';
|
|
||||||
animationIntersector.checkAnimations(undefined, 'STICKERS-SEARCH');
|
animationIntersector.checkAnimations(undefined, 'STICKERS-SEARCH');
|
||||||
|
return super.onCloseAfterTimeout();
|
||||||
}
|
}
|
||||||
|
|
||||||
public renderSet(set: StickerSet.stickerSet) {
|
public renderSet(set: StickerSet.stickerSet) {
|
||||||
@ -177,12 +176,13 @@ export default class AppStickersTab implements SliderTab {
|
|||||||
this.setsDiv.append(div);
|
this.setsDiv.append(div);
|
||||||
}
|
}
|
||||||
|
|
||||||
public init() {
|
public open() {
|
||||||
appSidebarRight.selectTab(AppSidebarRight.SLIDERITEMSIDS.stickers);
|
const ret = super.open();
|
||||||
|
|
||||||
appSidebarRight.toggleSidebar(true).then(() => {
|
appSidebarRight.toggleSidebar(true).then(() => {
|
||||||
this.renderFeatured();
|
this.renderFeatured();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
public renderFeatured() {
|
public renderFeatured() {
|
||||||
|
@ -117,6 +117,14 @@ export default class SidebarSlider {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public getTab(tabConstructor: SliderSuperTabConstructable) {
|
||||||
|
return this.historyTabIds.find(t => t instanceof tabConstructor) as SliderSuperTab;
|
||||||
|
}
|
||||||
|
|
||||||
|
public isTabExists(tabConstructor: SliderSuperTabConstructable) {
|
||||||
|
return !!this.getTab(tabConstructor);
|
||||||
|
}
|
||||||
|
|
||||||
protected onCloseTab(id: number | SliderSuperTab, animate: boolean, isNavigation?: boolean) {
|
protected onCloseTab(id: number | SliderSuperTab, animate: boolean, isNavigation?: boolean) {
|
||||||
if(!isNavigation) {
|
if(!isNavigation) {
|
||||||
appNavigationController.removeByType(this.navigationType, true);
|
appNavigationController.removeByType(this.navigationType, true);
|
||||||
|
@ -178,25 +178,6 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="sidebar-slider-item chatlist-container" id="search-private-container">
|
|
||||||
<div class="sidebar-header">
|
|
||||||
<button class="btn-icon tgico-close sidebar-close-button"></button>
|
|
||||||
</div>
|
|
||||||
<div class="chatlist-container"></div>
|
|
||||||
</div>
|
|
||||||
<div class="sidebar-slider-item chatlist-container" id="stickers-container">
|
|
||||||
<div class="sidebar-header">
|
|
||||||
<button class="btn-icon tgico-close sidebar-close-button"></button>
|
|
||||||
</div>
|
|
||||||
<div class="sidebar-content"><div class="sticker-sets"></div></div>
|
|
||||||
</div>
|
|
||||||
<div class="sidebar-slider-item chatlist-container" id="poll-results-container">
|
|
||||||
<div class="sidebar-header">
|
|
||||||
<button class="btn-icon tgico-close sidebar-close-button"></button>
|
|
||||||
<div class="sidebar-header__title">Results</div>
|
|
||||||
</div>
|
|
||||||
<div class="sidebar-content"><div class="poll-results"></div></div>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -37,6 +37,7 @@ import appStateManager, { AppStateManager } from './appStateManager';
|
|||||||
import { MOUNT_CLASS_TO } from '../../config/debug';
|
import { MOUNT_CLASS_TO } from '../../config/debug';
|
||||||
import appNavigationController from '../../components/appNavigationController';
|
import appNavigationController from '../../components/appNavigationController';
|
||||||
import appNotificationsManager from './appNotificationsManager';
|
import appNotificationsManager from './appNotificationsManager';
|
||||||
|
import AppPrivateSearchTab from '../../components/sidebarRight/tabs/search';
|
||||||
|
|
||||||
//console.log('appImManager included33!');
|
//console.log('appImManager included33!');
|
||||||
|
|
||||||
@ -624,8 +625,9 @@ export class AppImManager {
|
|||||||
if(justReturn) {
|
if(justReturn) {
|
||||||
rootScope.broadcast('peer_changed', this.chat.peerId);
|
rootScope.broadcast('peer_changed', this.chat.peerId);
|
||||||
|
|
||||||
if(appSidebarRight.historyTabIds[appSidebarRight.historyTabIds.length - 1] === AppSidebarRight.SLIDERITEMSIDS.search) {
|
const searchTab = appSidebarRight.getTab(AppPrivateSearchTab);
|
||||||
appSidebarRight.onCloseBtnClick();
|
if(searchTab) {
|
||||||
|
searchTab.close();
|
||||||
}
|
}
|
||||||
|
|
||||||
appSidebarRight.sharedMediaTab.setPeer(this.chat.peerId, this.chat.threadId);
|
appSidebarRight.sharedMediaTab.setPeer(this.chat.peerId, this.chat.threadId);
|
||||||
|
@ -736,7 +736,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.user-caption {
|
.user-caption {
|
||||||
padding: 6px 28px;
|
padding: 3px 28px 6px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.user-title {
|
.user-title {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user