Browse Source

omg3

master
Eduard Kuzmenko 2 years ago
parent
commit
73a2d20712
  1. 4
      .env
  2. 12
      src/components/appMediaViewer.ts
  3. 4
      src/components/appSelectPeers.ts
  4. 4
      src/components/sidebarLeft/tabs/includedChats.ts

4
.env

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
API_ID=1025907
API_HASH=452b0359b988148995f22ff0f4229750
VERSION=1.5.0
VERSION_FULL=1.5.0 (213)
BUILD=213
VERSION_FULL=1.5.0 (214)
BUILD=214

12
src/components/appMediaViewer.ts

@ -7,6 +7,7 @@ @@ -7,6 +7,7 @@
import MEDIA_MIME_TYPES_SUPPORTED from "../environment/mediaMimeTypesSupport";
import cancelEvent from "../helpers/dom/cancelEvent";
import { attachClickEvent, detachClickEvent } from "../helpers/dom/clickEvent";
import findUpTag from "../helpers/dom/findUpTag";
import setInnerHTML from "../helpers/dom/setInnerHTML";
import mediaSizes from "../helpers/mediaSizes";
import SearchListLoader from "../helpers/searchListLoader";
@ -129,8 +130,9 @@ export default class AppMediaViewer extends AppMediaViewerBase<'caption', 'delet @@ -129,8 +130,9 @@ export default class AppMediaViewer extends AppMediaViewerBase<'caption', 'delet
attachClickEvent(this.author.container, this.onAuthorClick);
const onCaptionClick = (e: MouseEvent) => {
if(e.target instanceof HTMLAnchorElement) { // close viewer if it's t.me/ redirect
const onclick = (e.target as HTMLElement).getAttribute('onclick');
const a = findUpTag(e.target, 'A');
if(a instanceof HTMLAnchorElement) { // close viewer if it's t.me/ redirect
const onclick = a.getAttribute('onclick');
if(!onclick || onclick.includes('showMaskedAlert')) {
return;
}
@ -138,15 +140,15 @@ export default class AppMediaViewer extends AppMediaViewerBase<'caption', 'delet @@ -138,15 +140,15 @@ export default class AppMediaViewer extends AppMediaViewerBase<'caption', 'delet
cancelEvent(e);
this.close().then(() => {
detachClickEvent(this.content.caption, onCaptionClick, {capture: true});
(e.target as HTMLAnchorElement).click();
this.content.caption.removeEventListener('click', onCaptionClick, {capture: true});
a.click();
});
return false;
}
};
attachClickEvent(this.content.caption, onCaptionClick, {capture: true});
this.content.caption.addEventListener('click', onCaptionClick, {capture: true});
}
/* public close(e?: MouseEvent) {

4
src/components/appSelectPeers.ts

@ -21,7 +21,7 @@ import debounce from "../helpers/schedulers/debounce"; @@ -21,7 +21,7 @@ import debounce from "../helpers/schedulers/debounce";
import windowSize from "../helpers/windowSize";
import type { IsPeerType } from "../lib/appManagers/appPeersManager";
import { generateDelimiter, SettingSection } from "./sidebarLeft";
import { attachClickEvent } from "../helpers/dom/clickEvent";
import { attachClickEvent, simulateClickEvent } from "../helpers/dom/clickEvent";
import filterUnique from "../helpers/array/filterUnique";
import indexOfAndSplice from "../helpers/array/indexOfAndSplice";
import safeAssign from "../helpers/object/safeAssign";
@ -187,7 +187,7 @@ export default class AppSelectPeers { @@ -187,7 +187,7 @@ export default class AppSelectPeers {
if(!li) {
this.remove(peerId.toPeerId());
} else {
li.click();
simulateClickEvent(li);
}
});

4
src/components/sidebarLeft/tabs/includedChats.ts

@ -19,7 +19,7 @@ import copy from "../../../helpers/object/copy"; @@ -19,7 +19,7 @@ import copy from "../../../helpers/object/copy";
import forEachReverse from "../../../helpers/array/forEachReverse";
import setInnerHTML from "../../../helpers/dom/setInnerHTML";
import wrapEmojiText from "../../../lib/richTextProcessor/wrapEmojiText";
import { attachClickEvent } from "../../../helpers/dom/clickEvent";
import { attachClickEvent, simulateClickEvent } from "../../../helpers/dom/clickEvent";
export default class AppIncludedChatsTab extends SliderSuperTab {
private editFolderTab: AppEditFolderTab;
@ -251,7 +251,7 @@ export default class AppIncludedChatsTab extends SliderSuperTab { @@ -251,7 +251,7 @@ export default class AppIncludedChatsTab extends SliderSuperTab {
for(const flag in filter.pFlags) {
// @ts-ignore
if(details.hasOwnProperty(flag) && !!filter.pFlags[flag]) {
(categoriesSection.content.querySelector(`[data-peer-id="${flag}"]`) as HTMLElement).click();
simulateClickEvent(categoriesSection.content.querySelector(`[data-peer-id="${flag}"]`) as HTMLElement);
}
}
}

Loading…
Cancel
Save