20Q added a summary

Some language refactoring
Allow toggle even without editing perm
Fix DnD on school rank with npc as they don't have it
This commit is contained in:
Vlyan
2021-01-03 12:22:53 +01:00
parent b1298c50c4
commit 791a98eb3c
10 changed files with 308 additions and 221 deletions

View File

@@ -83,6 +83,13 @@ export class ItemSheetL5r5e extends ItemSheet {
activateListeners(html) {
super.activateListeners(html);
// Toggle
html.find(".toggle-on-click").on("click", (event) => {
const elmt = $(event.currentTarget).data("toggle");
const tgt = html.find("." + elmt);
tgt.hasClass("toggle-active") ? tgt.removeClass("toggle-active") : tgt.addClass("toggle-active");
});
// Everything below here is only needed if the sheet is editable
if (!this.options.editable) {
return;
@@ -93,13 +100,6 @@ export class ItemSheetL5r5e extends ItemSheet {
event.target.select();
});
// Toggle
html.find(".toggle-on-click").on("click", (event) => {
const elmt = $(event.currentTarget).data("toggle");
const tgt = html.find("." + elmt);
tgt.hasClass("toggle-active") ? tgt.removeClass("toggle-active") : tgt.addClass("toggle-active");
});
// Delete a property
html.find(`.property-delete`).on("click", (event) => {
const li = $(event.currentTarget).parents(".property");