#11 Gestion conteneur et suppression
This commit is contained in:
parent
2f438ccd10
commit
41df6257d5
@ -175,6 +175,31 @@ export class RdDActorSheet extends ActorSheet {
|
|||||||
this.actor.computeEncombrementTotal();
|
this.actor.computeEncombrementTotal();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* -------------------------------------------- */
|
||||||
|
async confirmerSuppression(li) {
|
||||||
|
let itemId = li.data("item-id");
|
||||||
|
let d = new Dialog({
|
||||||
|
title: "Confirmer la suppression",
|
||||||
|
content: "<p>Etes vous certain de vouloir supprimer cet objet ?</p>",
|
||||||
|
buttons: {
|
||||||
|
delete: {
|
||||||
|
icon: '<i class="fas fa-check"></i>',
|
||||||
|
label: "Supprimer",
|
||||||
|
callback: () => {
|
||||||
|
this.actor.deleteOwnedItem( itemId );
|
||||||
|
li.slideUp(200, () => this.render(false));
|
||||||
|
}
|
||||||
|
},
|
||||||
|
cancel: {
|
||||||
|
icon: '<i class="fas fa-times"></i>',
|
||||||
|
label: "Annuler"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
default: "cancel",
|
||||||
|
});
|
||||||
|
d.render(true);
|
||||||
|
}
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
/** @override */
|
/** @override */
|
||||||
activateListeners(html) {
|
activateListeners(html) {
|
||||||
@ -193,9 +218,7 @@ export class RdDActorSheet extends ActorSheet {
|
|||||||
// Delete Inventory Item
|
// Delete Inventory Item
|
||||||
html.find('.item-delete').click(ev => {
|
html.find('.item-delete').click(ev => {
|
||||||
const li = $(ev.currentTarget).parents(".item");
|
const li = $(ev.currentTarget).parents(".item");
|
||||||
this.actor.deleteOwnedItem(li.data("item-id"));
|
this.confirmerSuppression( li );
|
||||||
console.log("Delete item :", li.data("item-id") );
|
|
||||||
li.slideUp(200, () => this.render(false));
|
|
||||||
});
|
});
|
||||||
|
|
||||||
// Update Inventory Item
|
// Update Inventory Item
|
||||||
|
Loading…
Reference in New Issue
Block a user