Compare commits

...

2 commits

Author SHA1 Message Date
WBHarry
1f4241437e using function.call instead of function.bind 2026-04-20 22:18:41 +02:00
WBHarry
4800b3a943
Apply suggestions from code review
Co-authored-by: Carlos Fernandez <CarlosFdez@users.noreply.github.com>
2026-04-20 22:15:13 +02:00
3 changed files with 5 additions and 7 deletions

View file

@ -113,7 +113,6 @@
"sectionTitle": "Areas", "sectionTitle": "Areas",
"shape": "Shape", "shape": "Shape",
"size": "Size" "size": "Size"
}, },
"displayInChat": "Display in chat", "displayInChat": "Display in chat",
"deleteTriggerTitle": "Delete Trigger", "deleteTriggerTitle": "Delete Trigger",

View file

@ -63,11 +63,10 @@ export default class DHActionConfig extends DHActionBaseConfig {
effectId = this.action.area[areaIndex].effects[index]; effectId = this.action.area[areaIndex].effects[index];
const data = this.action.toObject(); const data = this.action.toObject();
data.area[areaIndex].effects.splice(index, 1); data.area[areaIndex].effects.splice(index, 1);
this.constructor.updateForm.bind(this)(null, null, { object: foundry.utils.flattenObject(data) }); this.constructor.updateForm.call(this, null, null, { object: foundry.utils.flattenObject(data) });
} } else {
else {
effectId = this.action.effects[index]._id; effectId = this.action.effects[index]._id;
this.constructor.removeElement.bind(this)(event, button); this.constructor.removeElement.call(this, event, button);
} }
this.action.item.deleteEmbeddedDocuments('ActiveEffect', [effectId]); this.action.item.deleteEmbeddedDocuments('ActiveEffect', [effectId]);

View file

@ -56,10 +56,10 @@ export default class DHActionSettingsConfig extends DHActionBaseConfig {
effectId = this.action.area[areaIndex].effects[index]; effectId = this.action.area[areaIndex].effects[index];
const data = this.action.toObject(); const data = this.action.toObject();
data.area[areaIndex].effects.splice(index, 1); data.area[areaIndex].effects.splice(index, 1);
this.constructor.updateForm.bind(this)(null, null, { object: foundry.utils.flattenObject(data) }); this.constructor.updateForm.call(this, null, null, { object: foundry.utils.flattenObject(data) });
} else { } else {
effectId = this.action.effects[index]._id; effectId = this.action.effects[index]._id;
this.constructor.removeElement.bind(this)(event, button); this.constructor.removeElement.call(this, event, button);
} }