use jQuery path for _showControlWhen
This commit is contained in:
parent
1bcfba1f68
commit
a93b34d2ce
@ -234,7 +234,7 @@ export class RdDActorSheet extends ActorSheet {
|
|||||||
activateListeners(html) {
|
activateListeners(html) {
|
||||||
super.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
|
// Everything below here is only needed if the sheet is editable
|
||||||
if (!this.options.editable) return;
|
if (!this.options.editable) return;
|
||||||
|
@ -1,10 +1,10 @@
|
|||||||
export class HtmlUtility{
|
export class HtmlUtility{
|
||||||
static _showControlWhen(control, condition) {
|
static _showControlWhen(control, condition) {
|
||||||
if (condition) {
|
if (condition) {
|
||||||
$(control).show();
|
control.show();
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$(control).hide();
|
control.hide();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -387,7 +387,7 @@ export class RdDCalendrier extends Application {
|
|||||||
activateListeners(html) {
|
activateListeners(html) {
|
||||||
super.activateListeners(html);
|
super.activateListeners(html);
|
||||||
|
|
||||||
HtmlUtility._showControlWhen(".gm-only", game.user.isGM);
|
HtmlUtility._showControlWhen($(".gm-only"), game.user.isGM);
|
||||||
|
|
||||||
this.updateDisplay();
|
this.updateDisplay();
|
||||||
|
|
||||||
|
@ -118,15 +118,15 @@ export class RdDRoll extends Dialog {
|
|||||||
dmgText = '(' + dmgText + ')';
|
dmgText = '(' + dmgText + ')';
|
||||||
}
|
}
|
||||||
|
|
||||||
HtmlUtility._showControlWhen(".diffMoral", rollData.selectedCarac == actor.data.data.carac.volonte);
|
HtmlUtility._showControlWhen($(".diffMoral"), rollData.selectedCarac == actor.data.data.carac.volonte);
|
||||||
HtmlUtility._showControlWhen(".etat-general", !dialog._isIgnoreEtatGeneral(rollData));
|
HtmlUtility._showControlWhen($(".etat-general"), !dialog._isIgnoreEtatGeneral(rollData));
|
||||||
|
|
||||||
// Sort management
|
// Sort management
|
||||||
if (rollData.selectedSort) {
|
if (rollData.selectedSort) {
|
||||||
rollData.bonus = RdDItemSort.getCaseBonus(rollData.selectedSort, rollData.coord),
|
rollData.bonus = RdDItemSort.getCaseBonus(rollData.selectedSort, rollData.coord),
|
||||||
//console.log("Toggle show/hide", rollData.selectedSort);
|
//console.log("Toggle show/hide", rollData.selectedSort);
|
||||||
HtmlUtility._showControlWhen("#div-sort-difficulte", RdDItemSort.isDifficulteVariable(rollData.selectedSort))
|
HtmlUtility._showControlWhen($("#div-sort-difficulte"), RdDItemSort.isDifficulteVariable(rollData.selectedSort))
|
||||||
HtmlUtility._showControlWhen("#div-sort-ptreve", RdDItemSort.isCoutVariable(rollData.selectedSort))
|
HtmlUtility._showControlWhen($("#div-sort-ptreve"), RdDItemSort.isCoutVariable(rollData.selectedSort))
|
||||||
}
|
}
|
||||||
|
|
||||||
// Mise à jour valeurs
|
// Mise à jour valeurs
|
||||||
|
Loading…
Reference in New Issue
Block a user