Stop some missing propagation

This commit is contained in:
Vlyan
2021-01-05 17:49:38 +01:00
parent 5fb1fbb595
commit 6ef4dd3bde
7 changed files with 33 additions and 2 deletions

View File

@@ -147,6 +147,8 @@ export class TwentyQuestionsDialog extends FormApplication {
// Toggle
html.find(".toggle-on-click").on("click", (event) => {
event.preventDefault();
event.stopPropagation();
const elmt = $(event.currentTarget).data("toggle");
const tgt = html.find("." + elmt);
tgt.hasClass("toggle-active") ? tgt.removeClass("toggle-active") : tgt.addClass("toggle-active");
@@ -179,6 +181,8 @@ export class TwentyQuestionsDialog extends FormApplication {
// Delete a dnd element
html.find(".property-delete").on("click", (event) => {
event.preventDefault();
event.stopPropagation();
const stepKey = $(event.currentTarget).parents(".tq-drag-n-drop").data("step");
const itemId = $(event.currentTarget).parents(".property").data("propertyId");
this._deleteOwnedItem(stepKey, itemId);
@@ -187,6 +191,8 @@ export class TwentyQuestionsDialog extends FormApplication {
// Submit button
html.find("#generate").on("click", async (event) => {
event.preventDefault();
event.stopPropagation();
await this.object.toActor(this.actor, flattenObject(this.cache));
await this.close({ submit: true, force: true });
});