Fix error changement categorie
This commit is contained in:
parent
c6c098b635
commit
67631a46df
@ -105,9 +105,9 @@ export class RdDItemSheet extends ItemSheet {
|
|||||||
// 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;
|
||||||
|
|
||||||
|
|
||||||
// Select competence categorie
|
// Select competence categorie
|
||||||
html.find(".categorie").on("click", this._onClickSelectCategorie.bind(this) );
|
html.find(".categorie").change(event => this._onSelectCategorie(event));
|
||||||
html.find(".categoriepotion").on("click", this.render(true) );
|
|
||||||
|
|
||||||
html.find('.sheet-competence-xp').change((event) => {
|
html.find('.sheet-competence-xp').change((event) => {
|
||||||
if ( this.object.data.type == 'competence') {
|
if ( this.object.data.type == 'competence') {
|
||||||
@ -153,13 +153,15 @@ export class RdDItemSheet extends ItemSheet {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
async _onClickSelectCategorie(event) {
|
async _onSelectCategorie(event) {
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
|
|
||||||
|
if (this.object.isCompetence()){
|
||||||
let level = RdDItemCompetence.getNiveauBase(event.currentTarget.value);
|
let level = RdDItemCompetence.getNiveauBase(event.currentTarget.value);
|
||||||
Misc.templateData(this.object).base = level;
|
Misc.templateData(this.object).base = level;
|
||||||
$("#base").val(level);
|
$("#base").val(level);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
get template()
|
get template()
|
||||||
|
@ -17,6 +17,10 @@ export class RdDItem extends Item {
|
|||||||
return typesObjetsOeuvres;
|
return typesObjetsOeuvres;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
isCompetence() {
|
||||||
|
return Misc.data(this).type == 'competence';
|
||||||
|
}
|
||||||
|
|
||||||
isConteneur() {
|
isConteneur() {
|
||||||
return Misc.data(this).type == 'conteneur';
|
return Misc.data(this).type == 'conteneur';
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user