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'; | ||||
| 
 | ||||
| function qs (selector, parent) { | ||||
|   return document.querySelector(selector); | ||||
|     return parent ? parent.querySelector(selector) : document.querySelector(selector); | ||||
| } | ||||
| 
 | ||||
| function qsa (selector, parent) { | ||||
|   return document.querySelectorAll(selector); | ||||
|     return parent ? parent.querySelectorAll(selector) : document.querySelectorAll(selector); | ||||
| } | ||||
| 
 | ||||
| function hide(el) { | ||||
|  | @ -33,13 +33,14 @@ function showVideoInnerHTML (event) { | |||
| 
 | ||||
| function toggleShirtSize (form) { | ||||
|     let wantShirt = form.elements['on0'].value === 'wantGiftYes'; | ||||
|     let shirtSizeSelector = form.elements['os0']; | ||||
|     shirtSizeSelector.disabled = !wantShirt; | ||||
|     let shirtSizeRow = qs('.t-shirt-size-selector', form); | ||||
|     let shirtSizeSelect = form.elements['os0']; | ||||
|     shirtSizeSelect.disabled = !wantShirt; | ||||
|     form.elements['no_shipping'].value = wantShirt ? '2' : '0'; | ||||
|     if (wantShirt) { | ||||
|         show(shirtSizeSelector); | ||||
|         show(shirtSizeRow); | ||||
|     } else { | ||||
|         hide(shirtSizeSelector); | ||||
|         hide(shirtSizeRow); | ||||
|     } | ||||
| } | ||||
| 
 | ||||
|  |  | |||
		Loading…
	
	Add table
		
		Reference in a new issue