diff --git a/module/actor-sheet.js b/module/actor-sheet.js index ecbbdf66..20bd8f12 100644 --- a/module/actor-sheet.js +++ b/module/actor-sheet.js @@ -234,7 +234,7 @@ export class RdDActorSheet extends ActorSheet { activateListeners(html) { super.activateListeners(html); - HtmlUtility._showControlWhen(".gm-only", game.user.isGM); + HtmlUtility._showControlWhen($(".gm-only"), game.user.isGM); // Everything below here is only needed if the sheet is editable if (!this.options.editable) return; diff --git a/module/html-utility.js b/module/html-utility.js index 28f3551d..1566039c 100644 --- a/module/html-utility.js +++ b/module/html-utility.js @@ -1,10 +1,10 @@ export class HtmlUtility{ static _showControlWhen(control, condition) { if (condition) { - $(control).show(); + control.show(); } else { - $(control).hide(); + control.hide(); } } } \ No newline at end of file diff --git a/module/rdd-calendrier.js b/module/rdd-calendrier.js index bd9d0dda..4d2fcaf7 100644 --- a/module/rdd-calendrier.js +++ b/module/rdd-calendrier.js @@ -387,7 +387,7 @@ export class RdDCalendrier extends Application { activateListeners(html) { super.activateListeners(html); - HtmlUtility._showControlWhen(".gm-only", game.user.isGM); + HtmlUtility._showControlWhen($(".gm-only"), game.user.isGM); this.updateDisplay(); diff --git a/module/rdd-roll.js b/module/rdd-roll.js index 3a22fc1f..156818a5 100644 --- a/module/rdd-roll.js +++ b/module/rdd-roll.js @@ -118,15 +118,15 @@ export class RdDRoll extends Dialog { dmgText = '(' + dmgText + ')'; } - HtmlUtility._showControlWhen(".diffMoral", rollData.selectedCarac == actor.data.data.carac.volonte); - HtmlUtility._showControlWhen(".etat-general", !dialog._isIgnoreEtatGeneral(rollData)); + HtmlUtility._showControlWhen($(".diffMoral"), rollData.selectedCarac == actor.data.data.carac.volonte); + HtmlUtility._showControlWhen($(".etat-general"), !dialog._isIgnoreEtatGeneral(rollData)); // Sort management if (rollData.selectedSort) { rollData.bonus = RdDItemSort.getCaseBonus(rollData.selectedSort, rollData.coord), //console.log("Toggle show/hide", rollData.selectedSort); - HtmlUtility._showControlWhen("#div-sort-difficulte", RdDItemSort.isDifficulteVariable(rollData.selectedSort)) - HtmlUtility._showControlWhen("#div-sort-ptreve", RdDItemSort.isCoutVariable(rollData.selectedSort)) + HtmlUtility._showControlWhen($("#div-sort-difficulte"), RdDItemSort.isDifficulteVariable(rollData.selectedSort)) + HtmlUtility._showControlWhen($("#div-sort-ptreve"), RdDItemSort.isCoutVariable(rollData.selectedSort)) } // Mise à jour valeurs