Forward an album if target is not the album's item
This commit is contained in:
parent
5a83019619
commit
c43fa1021e
@ -8,18 +8,16 @@ import $rootScope from "../../lib/rootScope";
|
|||||||
import { cancelEvent, cancelSelection, findUpClassName } from "../../lib/utils";
|
import { cancelEvent, cancelSelection, findUpClassName } from "../../lib/utils";
|
||||||
import ButtonMenu, { ButtonMenuItemOptions } from "../buttonMenu";
|
import ButtonMenu, { ButtonMenuItemOptions } from "../buttonMenu";
|
||||||
import { attachContextMenuListener, openBtnMenu, positionMenu } from "../misc";
|
import { attachContextMenuListener, openBtnMenu, positionMenu } from "../misc";
|
||||||
import { PopupButton } from "../popup";
|
|
||||||
import PopupDeleteMessages from "../popupDeleteMessages";
|
import PopupDeleteMessages from "../popupDeleteMessages";
|
||||||
import PopupForward from "../popupForward";
|
import PopupForward from "../popupForward";
|
||||||
import PopupPeer from "../popupPeer";
|
|
||||||
import PopupPinMessage from "../popupUnpinMessage";
|
import PopupPinMessage from "../popupUnpinMessage";
|
||||||
import appSidebarRight from "../sidebarRight";
|
|
||||||
|
|
||||||
export default class ChatContextMenu {
|
export default class ChatContextMenu {
|
||||||
private buttons: (ButtonMenuItemOptions & {verify: () => boolean, notDirect?: () => boolean})[];
|
private buttons: (ButtonMenuItemOptions & {verify: () => boolean, notDirect?: () => boolean})[];
|
||||||
private element: HTMLElement;
|
private element: HTMLElement;
|
||||||
|
|
||||||
private target: HTMLElement;
|
private target: HTMLElement;
|
||||||
|
private isTargetAnAlbumItem: boolean;
|
||||||
public peerID: number;
|
public peerID: number;
|
||||||
public msgID: number;
|
public msgID: number;
|
||||||
|
|
||||||
@ -51,6 +49,7 @@ export default class ChatContextMenu {
|
|||||||
this.target = e.target as HTMLElement;
|
this.target = e.target as HTMLElement;
|
||||||
|
|
||||||
const albumItem = findUpClassName(this.target, 'album-item');
|
const albumItem = findUpClassName(this.target, 'album-item');
|
||||||
|
this.isTargetAnAlbumItem = !!albumItem;
|
||||||
if(albumItem) {
|
if(albumItem) {
|
||||||
this.msgID = +albumItem.dataset.mid;
|
this.msgID = +albumItem.dataset.mid;
|
||||||
} else {
|
} else {
|
||||||
@ -230,7 +229,7 @@ export default class ChatContextMenu {
|
|||||||
};
|
};
|
||||||
|
|
||||||
private onForwardClick = () => {
|
private onForwardClick = () => {
|
||||||
new PopupForward([this.msgID]);
|
new PopupForward(this.isTargetAnAlbumItem ? [this.msgID] : appMessagesManager.getMidsByMid(this.msgID));
|
||||||
};
|
};
|
||||||
|
|
||||||
private onSelectClick = () => {
|
private onSelectClick = () => {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user