Some fixes
This commit is contained in:
parent
3f0e7c3195
commit
b83982b8b9
src
components
lib
@ -29,6 +29,7 @@ import pause from "../../helpers/schedulers/pause";
|
|||||||
import { IS_APPLE_MOBILE } from "../../environment/userAgent";
|
import { IS_APPLE_MOBILE } from "../../environment/userAgent";
|
||||||
import { AppManagers } from "../../lib/appManagers/managers";
|
import { AppManagers } from "../../lib/appManagers/managers";
|
||||||
import type LazyLoadQueueIntersector from "../lazyLoadQueueIntersector";
|
import type LazyLoadQueueIntersector from "../lazyLoadQueueIntersector";
|
||||||
|
import { simulateClickEvent } from "../../helpers/dom/clickEvent";
|
||||||
|
|
||||||
export const EMOTICONSSTICKERGROUP = 'emoticons-dropdown';
|
export const EMOTICONSSTICKERGROUP = 'emoticons-dropdown';
|
||||||
|
|
||||||
@ -176,7 +177,7 @@ export class EmoticonsDropdown extends DropdownHover {
|
|||||||
(this.tabsEl.children[1] as HTMLElement).classList.add('hide');
|
(this.tabsEl.children[1] as HTMLElement).classList.add('hide');
|
||||||
}
|
}
|
||||||
|
|
||||||
(this.tabsEl.children[INIT_TAB_ID + 1] as HTMLLIElement).click(); // set emoji tab
|
simulateClickEvent(this.tabsEl.children[INIT_TAB_ID + 1] as HTMLElement); // set emoji tab
|
||||||
if(this.tabs[INIT_TAB_ID].init) {
|
if(this.tabs[INIT_TAB_ID].init) {
|
||||||
this.tabs[INIT_TAB_ID].init(); // onTransitionEnd не вызовется, т.к. это первая открытая вкладка
|
this.tabs[INIT_TAB_ID].init(); // onTransitionEnd не вызовется, т.к. это первая открытая вкладка
|
||||||
}
|
}
|
||||||
|
@ -16,7 +16,7 @@ import { fastRaf } from "../helpers/schedulers";
|
|||||||
import SetTransition from "./singleTransition";
|
import SetTransition from "./singleTransition";
|
||||||
import findUpClassName from "../helpers/dom/findUpClassName";
|
import findUpClassName from "../helpers/dom/findUpClassName";
|
||||||
import cancelEvent from "../helpers/dom/cancelEvent";
|
import cancelEvent from "../helpers/dom/cancelEvent";
|
||||||
import { attachClickEvent, detachClickEvent } from "../helpers/dom/clickEvent";
|
import { attachClickEvent, detachClickEvent, simulateClickEvent } from "../helpers/dom/clickEvent";
|
||||||
import replaceContent from "../helpers/dom/replaceContent";
|
import replaceContent from "../helpers/dom/replaceContent";
|
||||||
import windowSize from "../helpers/windowSize";
|
import windowSize from "../helpers/windowSize";
|
||||||
import { Message, MessageMedia, Poll, PollResults } from "../layer";
|
import { Message, MessageMedia, Poll, PollResults } from "../layer";
|
||||||
@ -470,7 +470,7 @@ export default class PollElement extends HTMLElement {
|
|||||||
if(this.sentVote) {
|
if(this.sentVote) {
|
||||||
const correctResult = results.results.find((r) => r.pFlags.correct);
|
const correctResult = results.results.find((r) => r.pFlags.correct);
|
||||||
if(correctResult && !correctResult.pFlags.chosen) {
|
if(correctResult && !correctResult.pFlags.chosen) {
|
||||||
toggleHint.click();
|
simulateClickEvent(toggleHint);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -34,7 +34,7 @@ import App from "../../config/app";
|
|||||||
import ButtonMenuToggle from "../buttonMenuToggle";
|
import ButtonMenuToggle from "../buttonMenuToggle";
|
||||||
import replaceContent from "../../helpers/dom/replaceContent";
|
import replaceContent from "../../helpers/dom/replaceContent";
|
||||||
import sessionStorage from "../../lib/sessionStorage";
|
import sessionStorage from "../../lib/sessionStorage";
|
||||||
import { attachClickEvent, CLICK_EVENT_NAME } from "../../helpers/dom/clickEvent";
|
import { attachClickEvent, CLICK_EVENT_NAME, simulateClickEvent } from "../../helpers/dom/clickEvent";
|
||||||
import ButtonIcon from "../buttonIcon";
|
import ButtonIcon from "../buttonIcon";
|
||||||
import confirmationPopup from "../confirmationPopup";
|
import confirmationPopup from "../confirmationPopup";
|
||||||
import IS_GEOLOCATION_SUPPORTED from "../../environment/geolocationSupport";
|
import IS_GEOLOCATION_SUPPORTED from "../../environment/geolocationSupport";
|
||||||
@ -359,7 +359,7 @@ export class AppSidebarLeft extends SidebarSlider {
|
|||||||
|
|
||||||
const close = () => {
|
const close = () => {
|
||||||
//setTimeout(() => {
|
//setTimeout(() => {
|
||||||
this.backBtn.click();
|
simulateClickEvent(this.backBtn);
|
||||||
//}, 0);
|
//}, 0);
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -632,7 +632,7 @@ export class AppSidebarLeft extends SidebarSlider {
|
|||||||
this.inputSearch.input.addEventListener('focus', onFocus);
|
this.inputSearch.input.addEventListener('focus', onFocus);
|
||||||
onFocus();
|
onFocus();
|
||||||
|
|
||||||
this.backBtn.addEventListener('click', (e) => {
|
attachClickEvent(this.backBtn, (e) => {
|
||||||
this.toolsBtn.classList.add(activeClassName);
|
this.toolsBtn.classList.add(activeClassName);
|
||||||
this.backBtn.classList.remove(activeClassName);
|
this.backBtn.classList.remove(activeClassName);
|
||||||
this.toolsBtn.parentElement.firstElementChild.classList.toggle('state-back', false);
|
this.toolsBtn.parentElement.firstElementChild.classList.toggle('state-back', false);
|
||||||
|
@ -31,7 +31,7 @@ import lottieLoader from "../rlottie/lottieLoader";
|
|||||||
import { wrapPhoto } from "../../components/wrappers";
|
import { wrapPhoto } from "../../components/wrappers";
|
||||||
import AppEditFolderTab from "../../components/sidebarLeft/tabs/editFolder";
|
import AppEditFolderTab from "../../components/sidebarLeft/tabs/editFolder";
|
||||||
import appSidebarLeft, { SettingSection } from "../../components/sidebarLeft";
|
import appSidebarLeft, { SettingSection } from "../../components/sidebarLeft";
|
||||||
import { attachClickEvent } from "../../helpers/dom/clickEvent";
|
import { attachClickEvent, simulateClickEvent } from "../../helpers/dom/clickEvent";
|
||||||
import positionElementByIndex from "../../helpers/dom/positionElementByIndex";
|
import positionElementByIndex from "../../helpers/dom/positionElementByIndex";
|
||||||
import replaceContent from "../../helpers/dom/replaceContent";
|
import replaceContent from "../../helpers/dom/replaceContent";
|
||||||
import ConnectionStatusComponent from "../../components/connectionStatus";
|
import ConnectionStatusComponent from "../../components/connectionStatus";
|
||||||
@ -419,7 +419,7 @@ export class AppDialogsManager {
|
|||||||
this.scroll = this.scrollables[this.filterId];
|
this.scroll = this.scrollables[this.filterId];
|
||||||
|
|
||||||
//selectTab(0);
|
//selectTab(0);
|
||||||
(this.folders.menu.firstElementChild as HTMLElement).click();
|
simulateClickEvent(this.folders.menu.firstElementChild as HTMLElement);
|
||||||
}
|
}
|
||||||
|
|
||||||
public get chatList() {
|
public get chatList() {
|
||||||
@ -573,7 +573,7 @@ export class AppDialogsManager {
|
|||||||
|
|
||||||
// set tab
|
// set tab
|
||||||
//(this.folders.menu.firstElementChild.children[Math.max(0, filter.id - 2)] as HTMLElement).click();
|
//(this.folders.menu.firstElementChild.children[Math.max(0, filter.id - 2)] as HTMLElement).click();
|
||||||
(this.folders.menu.firstElementChild as HTMLElement).click();
|
simulateClickEvent(this.folders.menu.firstElementChild as HTMLElement);
|
||||||
|
|
||||||
elements.container.remove();
|
elements.container.remove();
|
||||||
elements.menu.remove();
|
elements.menu.remove();
|
||||||
|
@ -409,13 +409,7 @@ export class AppImManager extends EventListenerBase<{
|
|||||||
this.addEventListener('peer_changed', async(peerId) => {
|
this.addEventListener('peer_changed', async(peerId) => {
|
||||||
document.body.classList.toggle('has-chat', !!peerId);
|
document.body.classList.toggle('has-chat', !!peerId);
|
||||||
|
|
||||||
let str: string;
|
this.overrideHash(peerId);
|
||||||
if(peerId) {
|
|
||||||
const username = await this.managers.appPeersManager.getPeerUsername(peerId);
|
|
||||||
str = username ? '@' + username : '' + peerId;
|
|
||||||
}
|
|
||||||
|
|
||||||
appNavigationController.overrideHash(str);
|
|
||||||
|
|
||||||
apiManagerProxy.updateTabState('chatPeerIds', this.chats.map((chat) => chat.peerId).filter(Boolean));
|
apiManagerProxy.updateTabState('chatPeerIds', this.chats.map((chat) => chat.peerId).filter(Boolean));
|
||||||
});
|
});
|
||||||
@ -1512,6 +1506,16 @@ export class AppImManager extends EventListenerBase<{
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
private async overrideHash(peerId?: PeerId) {
|
||||||
|
let str: string;
|
||||||
|
if(peerId) {
|
||||||
|
const username = await this.managers.appPeersManager.getPeerUsername(peerId);
|
||||||
|
str = username ? '@' + username : '' + peerId;
|
||||||
|
}
|
||||||
|
|
||||||
|
appNavigationController.overrideHash(str);
|
||||||
|
}
|
||||||
|
|
||||||
public selectTab(id: number, animate?: boolean) {
|
public selectTab(id: number, animate?: boolean) {
|
||||||
if(animate === false) { // * will be used for Safari iOS history swipe
|
if(animate === false) { // * will be used for Safari iOS history swipe
|
||||||
disableTransition([appSidebarLeft.sidebarEl, this.columnEl, appSidebarRight.sidebarEl]);
|
disableTransition([appSidebarLeft.sidebarEl, this.columnEl, appSidebarRight.sidebarEl]);
|
||||||
@ -1519,6 +1523,8 @@ export class AppImManager extends EventListenerBase<{
|
|||||||
|
|
||||||
document.body.classList.toggle(LEFT_COLUMN_ACTIVE_CLASSNAME, id === 0);
|
document.body.classList.toggle(LEFT_COLUMN_ACTIVE_CLASSNAME, id === 0);
|
||||||
|
|
||||||
|
this.overrideHash(id > 0 ? this.chat?.peerId : undefined);
|
||||||
|
|
||||||
const prevTabId = this.tabId;
|
const prevTabId = this.tabId;
|
||||||
|
|
||||||
this.log('selectTab', id, prevTabId);
|
this.log('selectTab', id, prevTabId);
|
||||||
|
@ -97,7 +97,6 @@ export default class VideoPlayer extends ControlsHover {
|
|||||||
}).finally(() => { // due to autoplay, play will not call
|
}).finally(() => { // due to autoplay, play will not call
|
||||||
this.wrapper.classList.toggle('is-playing', !this.video.paused);
|
this.wrapper.classList.toggle('is-playing', !this.video.paused);
|
||||||
});
|
});
|
||||||
//(this.wrapper.querySelector('.toggle') as HTMLButtonElement).click();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user