This commit is contained in:
WBHarry 2026-01-27 18:55:25 +01:00
parent 82b60859da
commit c95520c9d8
2 changed files with 18 additions and 23 deletions

View file

@ -532,17 +532,6 @@ export default function DHApplicationMixin(Base) {
callback: async target => (await getDocFromElement(target)).toChat(this.document.uuid)
});
if (deletable)
options.push({
name: 'CONTROLS.CommonDelete',
icon: 'fa-solid fa-trash',
callback: async (target, event) => {
const doc = await getDocFromElement(target);
if (event.shiftKey) return doc.delete();
else return doc.deleteDialog();
}
});
options.push({
name: 'Unfavorite',
icon: 'fa-regular fa-star',
@ -553,15 +542,9 @@ export default function DHApplicationMixin(Base) {
},
callback: async (target, _event) => {
const doc = await getDocFromElement(target);
if (doc.type === 'domainCard') {
this.document.setFavoriteItem(doc, false);
} else {
this.document.update({
'system.sidebarFavorites': this.document.system.sidebarFavorites.filter(
x => x.id !== doc.id
)
});
}
this.document.update({
'system.sidebarFavorites': this.document.system.sidebarFavorites.filter(x => x.id !== doc.id)
});
}
});
@ -583,6 +566,17 @@ export default function DHApplicationMixin(Base) {
}
});
if (deletable)
options.push({
name: 'CONTROLS.CommonDelete',
icon: 'fa-solid fa-trash',
callback: async (target, event) => {
const doc = await getDocFromElement(target);
if (event.shiftKey) return doc.delete();
else return doc.deleteDialog();
}
});
return options.map(option => ({
...option,
icon: `<i class="${option.icon}"></i>`