forked from CGM_Public/pretix_original
New implementation of sales channels (#4111)
Co-authored-by: Martin Gross <gross@rami.io>
This commit is contained in:
@@ -45,9 +45,26 @@ $(function () {
|
||||
$el.find(".variation-error").toggleClass("hidden", !(
|
||||
$el.find(".alert-danger, .has-error").length
|
||||
));
|
||||
$el.find("input[name$=-sales_channels]").each(function () {
|
||||
$el.find("input[name$=-limit_sales_channels]").each(function () {
|
||||
console.log(
|
||||
$(this).val(),
|
||||
$el.find(".variation-channel-" + $(this).val()),
|
||||
(
|
||||
$(this).closest("[data-formset-form]").find("input[name$=-all_sales_channels]").prop("checked") ||
|
||||
$(this).prop("checked")
|
||||
), (
|
||||
$("input[name=all_sales_channels]").prop("checked") ||
|
||||
$("input[name=limit_sales_channels][value=" + $(this).val() + "]").prop("checked")
|
||||
)
|
||||
)
|
||||
$el.find(".variation-channel-" + $(this).val()).toggleClass("variation-icon-hidden", !(
|
||||
$(this).prop("checked") && $("input[name=sales_channels][value=" + $(this).val() + "]").prop("checked")
|
||||
(
|
||||
$(this).closest("[data-formset-form]").find("input[name$=-all_sales_channels]").prop("checked") ||
|
||||
$(this).prop("checked")
|
||||
) && (
|
||||
$("input[name=all_sales_channels]").prop("checked") ||
|
||||
$("input[name=limit_sales_channels][value=" + $(this).val() + "]").prop("checked")
|
||||
)
|
||||
));
|
||||
})
|
||||
}
|
||||
@@ -57,7 +74,7 @@ $(function () {
|
||||
update_variation_summary($el);
|
||||
$(this).on("change dp.change", "input", function () {update_variation_summary($el)});
|
||||
});
|
||||
$("input[name=sales_channels]").on("change", function() {
|
||||
$("input[name=limit_sales_channels] input[name=all_sales_channels]").on("change", function() {
|
||||
$("#item_variations [data-formset-form]").each(function () {
|
||||
update_variation_summary($(this));
|
||||
});
|
||||
|
||||
@@ -925,6 +925,11 @@ tbody th {
|
||||
margin-left: -1px;
|
||||
}
|
||||
|
||||
.fa-like-image {
|
||||
width: 1.28571em;
|
||||
height: auto;
|
||||
}
|
||||
|
||||
@import "../../pretixbase/scss/_rtl.scss";
|
||||
@import "../../bootstrap/scss/_rtl.scss";
|
||||
@import "_rtl.scss";
|
||||
|
||||
Reference in New Issue
Block a user