more better right click menus

This commit is contained in:
MathMan05 2025-01-16 22:42:05 -06:00
parent ea0b98e7ce
commit ebe6c5aae3
4 changed files with 97 additions and 29 deletions

View file

@ -342,13 +342,6 @@ class Group extends Channel {
user: User;
static contextmenu = new Contextmenu<Group, undefined>("channel menu");
static setupcontextmenu() {
this.contextmenu.addButton(
() => I18n.getTranslation("DMs.copyId"),
function (this: Group) {
navigator.clipboard.writeText(this.id);
},
);
this.contextmenu.addButton(
() => I18n.getTranslation("DMs.markRead"),
function (this: Group) {
@ -356,19 +349,32 @@ class Group extends Channel {
},
);
this.contextmenu.addSeperator();
this.contextmenu.addButton(
() => I18n.getTranslation("DMs.close"),
function (this: Group) {
this.deleteChannel();
},
{
color: "red",
},
);
this.contextmenu.addSeperator();
this.contextmenu.addButton(
() => I18n.getTranslation("user.copyId"),
function () {
navigator.clipboard.writeText(this.user.id);
},
);
this.contextmenu.addButton(
() => I18n.getTranslation("DMs.copyId"),
function (this: Group) {
navigator.clipboard.writeText(this.id);
},
);
}
constructor(json: dirrectjson, owner: Direct) {
super(-1, owner, json.id);