From 259878760202c8df99abeaaae70b3799d1180e94 Mon Sep 17 00:00:00 2001 From: Richard Schreiber Date: Wed, 29 Sep 2021 10:34:45 +0200 Subject: [PATCH] Customer profiles: add minor improvements around disabled fields and margins (#2195) --- src/pretix/static/pretixpresale/js/ui/questions.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/pretix/static/pretixpresale/js/ui/questions.js b/src/pretix/static/pretixpresale/js/ui/questions.js index a8d645bd58..27955f4fdf 100644 --- a/src/pretix/static/pretixpresale/js/ui/questions.js +++ b/src/pretix/static/pretixpresale/js/ui/questions.js @@ -227,7 +227,7 @@ function questions_init_profiles(el) { function getMatchingInput(key, answer, scope) { var $label; // _0 and _1 are e.g. for phone-fields. name-fields have their parts/keys already split - var $fields = $('[name$="' + key + '"], [name$="' + key + '_0"], [name$="' + key + '_1"]', scope); + var $fields = $('[name$="' + key + '"], [name$="' + key + '_0"], [name$="' + key + '_1"]', scope).not(":disabled"); if ($fields.length) return $fields; if (answer.identifier) { @@ -403,7 +403,9 @@ function questions_init_profiles(el) { // Add-Ons sit on same level as their parent product scope // Therefore use .prevUntil("legend") as an Add-On is // offset by a - $(scope).prevUntil("legend").addClass("profile-pre-select"); + // if no is present – e.g. on invoice-address – the + // containing would be selected, which is not what we want + $(scope).prevUntil("legend").not("summary").addClass("profile-pre-select"); $button.click(function() { Object.keys(selectedProfile).forEach(function(key) {