Fix shirt size for monthly an annual renew
This commit is contained in:
parent
0d25e1a87d
commit
fb690c1676
1 changed files with 7 additions and 6 deletions
|
@ -8,11 +8,11 @@
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
function qs (selector, parent) {
|
function qs (selector, parent) {
|
||||||
return document.querySelector(selector);
|
return parent ? parent.querySelector(selector) : document.querySelector(selector);
|
||||||
}
|
}
|
||||||
|
|
||||||
function qsa (selector, parent) {
|
function qsa (selector, parent) {
|
||||||
return document.querySelectorAll(selector);
|
return parent ? parent.querySelectorAll(selector) : document.querySelectorAll(selector);
|
||||||
}
|
}
|
||||||
|
|
||||||
function hide(el) {
|
function hide(el) {
|
||||||
|
@ -33,13 +33,14 @@ function showVideoInnerHTML (event) {
|
||||||
|
|
||||||
function toggleShirtSize (form) {
|
function toggleShirtSize (form) {
|
||||||
let wantShirt = form.elements['on0'].value === 'wantGiftYes';
|
let wantShirt = form.elements['on0'].value === 'wantGiftYes';
|
||||||
let shirtSizeSelector = form.elements['os0'];
|
let shirtSizeRow = qs('.t-shirt-size-selector', form);
|
||||||
shirtSizeSelector.disabled = !wantShirt;
|
let shirtSizeSelect = form.elements['os0'];
|
||||||
|
shirtSizeSelect.disabled = !wantShirt;
|
||||||
form.elements['no_shipping'].value = wantShirt ? '2' : '0';
|
form.elements['no_shipping'].value = wantShirt ? '2' : '0';
|
||||||
if (wantShirt) {
|
if (wantShirt) {
|
||||||
show(shirtSizeSelector);
|
show(shirtSizeRow);
|
||||||
} else {
|
} else {
|
||||||
hide(shirtSizeSelector);
|
hide(shirtSizeRow);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue