mirror of
https://github.com/MathMan05/Fermi.git
synced 2026-08-29 05:38:35 +00:00
fix group context menu
This commit is contained in:
@@ -393,6 +393,7 @@ class Contextmenu<x, y> {
|
||||
touchEnd: (x: number, y: number) => unknown = () => {},
|
||||
click: "right" | "left" = "right",
|
||||
side: "top" | "bottom" = "top",
|
||||
dontlayer = false,
|
||||
) {
|
||||
const func = (event: MouseEvent) => {
|
||||
const selectedText = window.getSelection();
|
||||
@@ -417,7 +418,7 @@ class Contextmenu<x, y> {
|
||||
obj.dispatchEvent(layered);
|
||||
};
|
||||
obj.addEventListener("layered", (layered) => {
|
||||
if (this.layered) {
|
||||
if (this.layered && !dontlayer) {
|
||||
layered.menus.push([this as Contextmenu<unknown, unknown>, addinfo, other]);
|
||||
} else if (!layered.primary) {
|
||||
layered.primary = [this as Contextmenu<unknown, unknown>, addinfo, other];
|
||||
|
||||
+12
-2
@@ -590,8 +590,18 @@ class Group extends Channel {
|
||||
}
|
||||
createguildHTML() {
|
||||
const div = document.createElement("div");
|
||||
Group.groupcontextmenu.bindContextmenu(div, this, undefined);
|
||||
if (this.type === 1 && this.users[0]) {
|
||||
const isSingle = this.type === 1 && this.users[0];
|
||||
Group.groupcontextmenu.bindContextmenu(
|
||||
div,
|
||||
this,
|
||||
undefined,
|
||||
undefined,
|
||||
undefined,
|
||||
undefined,
|
||||
undefined,
|
||||
!isSingle,
|
||||
);
|
||||
if (isSingle) {
|
||||
User.contextmenu.bindContextmenu(div, this.users[0], undefined);
|
||||
}
|
||||
this.html = new WeakRef(div);
|
||||
|
||||
Reference in New Issue
Block a user