Unified product-/chore-/battery-card modal handling

This commit is contained in:
Bernd Bestel
2023-05-23 17:32:54 +02:00
parent 2633d3d1a5
commit 08c1efa0ad
24 changed files with 266 additions and 343 deletions

View File

@@ -24,3 +24,9 @@ Grocy.Components.BatteryCard.Refresh = function(batteryId)
}
);
};
$(document).on("click", ".batterycard-trigger", function(e)
{
Grocy.Components.BatteryCard.Refresh($(e.currentTarget).attr("data-battery-id"));
$("#batterycard-modal").modal("show");
});

View File

@@ -48,3 +48,9 @@ Grocy.Components.ChoreCard.Refresh = function(choreId)
}
);
};
$(document).on("click", ".chorecard-trigger", function(e)
{
Grocy.Components.ChoreCard.Refresh($(e.currentTarget).attr("data-chore-id"));
$("#chorecard-modal").modal("show");
});

View File

@@ -265,3 +265,13 @@ $("#productcard-product-description").on("hidden.bs.collapse", function()
{
$(".expandable-text").find("a[data-toggle='collapse']").text(__t("Show more"));
})
$(document).on("click", ".productcard-trigger", function(e)
{
var productId = $(e.currentTarget).attr("data-product-id");
if (productId != "")
{
Grocy.Components.ProductCard.Refresh(productId);
$("#productcard-modal").modal("show");
}
});