Utilisation d'async/await dans les listeners
Sans async await dans les feuilles, la feuille n'est pas toujours mise à jour, laissant visible des informations obsoletes
This commit is contained in:
@ -34,8 +34,8 @@ export class RdDItemInventaireSheet extends RdDItemSheet {
|
||||
HtmlUtility.showControlWhen(this.html.find("div.description-milieu"), TYPE_ITEMS_NATURELS.includes(this.item.type));
|
||||
|
||||
if (!this.options.editable) return;
|
||||
this.html.find("a.preparer-nourriture").click(event => this.preparerNourriture(event));
|
||||
this.html.find("a.manger-nourriture").click(event => this.mangerNourriture(event));
|
||||
this.html.find("a.preparer-nourriture").click(async event => await this.preparerNourriture(event));
|
||||
this.html.find("a.manger-nourriture").click(async event => await this.mangerNourriture(event));
|
||||
|
||||
this.html.find("input.input-selection-milieu").keypress(event => {
|
||||
if (event.keyCode == '13') {
|
||||
@ -43,11 +43,11 @@ export class RdDItemInventaireSheet extends RdDItemSheet {
|
||||
}
|
||||
event.stopPropagation();
|
||||
})
|
||||
this.html.find("a.milieu-add").click(event => this.onAddMilieu(event));
|
||||
this.html.find("div.environnement-milieu a.milieu-delete").click(event => this.onDeleteMilieu(event));
|
||||
this.html.find("div.environnement-milieu select.environnement-rarete").change(event => this.onChange(event,
|
||||
this.html.find("a.milieu-add").click(async event => await this.onAddMilieu(event));
|
||||
this.html.find("div.environnement-milieu a.milieu-delete").click(async event => await this.onDeleteMilieu(event));
|
||||
this.html.find("div.environnement-milieu select.environnement-rarete").change(async event => await this.onChange(event,
|
||||
updated => this.$changeRarete(event, updated)));
|
||||
this.html.find("div.environnement-milieu input[name='environnement-frequence']").change(event => this.onChange(event,
|
||||
this.html.find("div.environnement-milieu input[name='environnement-frequence']").change(async event => await this.onChange(event,
|
||||
updated => this.$changeFrequence(event, updated)));
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user