Correction de l'ajout de milieux parfois KO

Pas sûr du pourquoi, il semble qu'il y a un souci jQuery
(avec deux fenêtres?)
This commit is contained in:
Vincent Vandemeulebrouck 2022-11-30 15:31:26 +01:00
parent e67ac96e93
commit 98c016696d
1 changed files with 3 additions and 3 deletions

View File

@ -151,7 +151,7 @@ export class EnvironmentSheetHelper {
static activateListeners(sheet, html) {
if (!sheet.options.editable) return;
html.find("a.milieu-add").click(event => EnvironmentSheetHelper.onAddMilieu(sheet, event));
html.find("a.milieu-add").click(event => EnvironmentSheetHelper.onAddMilieu(html, sheet, event));
html.find("div.environnement-milieu a.milieu-delete").click(event => EnvironmentSheetHelper.onDeleteMilieu(sheet, event));
html.find("div.environnement-milieu select.environnement-rarete").change(event => EnvironmentSheetHelper.onChange(sheet, event,
(updated) => {
@ -168,8 +168,8 @@ export class EnvironmentSheetHelper {
}));
}
static async onAddMilieu(sheet, event) {
const milieu = $("input.input-selection-milieu").val();
static async onAddMilieu(html, sheet, event) {
const milieu = html.find('input.input-selection-milieu').val();
if (!milieu) {
ui.notifications.warn(`Choisissez le milieu dans lequel se trouve le/la ${sheet.item.name}`);
return