mirror of
https://github.com/pretix/pretix.git
synced 2026-05-03 14:54:04 +00:00
Fix #1286 -- Autofill quota names with products
This commit is contained in:
@@ -18,3 +18,24 @@ $(function () {
|
||||
]
|
||||
});
|
||||
});
|
||||
|
||||
$(function () {
|
||||
if (!$("input[name=itemvars]").length) {
|
||||
return;
|
||||
}
|
||||
var autofill = ($("#id_name").val() === "");
|
||||
|
||||
$("#id_name").on("change keyup keydown keypress", function () {
|
||||
autofill = false;
|
||||
})
|
||||
|
||||
$("input[name=itemvars]").change(function () {
|
||||
if (autofill) {
|
||||
var names = [];
|
||||
$("input[name=itemvars]:checked").each(function () {
|
||||
names.push($.trim($(this).closest("label").text()))
|
||||
});
|
||||
$("#id_name").val(names.join(', '));
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user