js: Use three-part progressbar when no middle goal defined.
Since our current fundraiser doesn't have a "middle goal," this makes it a little easier to maintain the template and do the math.
This commit is contained in:
		
							parent
							
								
									df52029777
								
							
						
					
					
						commit
						8cb1f3f685
					
				
					 1 changed files with 9 additions and 7 deletions
				
			
		|  | @ -48,18 +48,20 @@ $(document).ready(function() { | |||
|     if (noCommaSiteSoFar >= noCommaSiteMiddleGoal) { | ||||
|         // We've got
 | ||||
|         var leftOver = noCommaMatchFinalGoal - noCommaSiteSoFar; | ||||
|         var supporterProgress = (noCommaSiteSoFar / noCommaSiteFinalGoal) * 100; | ||||
|         var matchProgress = (noCommaSiteMatchCount / noCommaSiteFinalGoal) * 100; | ||||
|         var needProgress = 100 - matchProgress; | ||||
| 
 | ||||
|         $('#siteprogressbar'). | ||||
|             multiprogressbar({ parts: [ | ||||
|                 { value: (noCommaSiteSoFar / noCommaSiteFinalGoal) * 100, | ||||
|                 { value: supporterProgress, | ||||
|                   text: noCommaSiteSoFar.toLocaleString() + " have joined!", | ||||
|                   barClass: "progress", textClass: "soFarText" }, | ||||
|                 { value: | ||||
|                   ((noCommaMatchFinalGoal - noCommaSiteMiddleGoal) / noCommaSiteFinalGoal) * 100, | ||||
|                   text: leftOver.toLocaleString() + " more needed to save license compliance work.", | ||||
|                 { value: needProgress, | ||||
|                   text: leftOver.toLocaleString() + " more needed", | ||||
|                   barClass: "final-goal", textClass: "goalText" }, | ||||
|                 { value: 100, | ||||
|                    text: siteMatchCount + " matched!", | ||||
|                   text: noCommaSiteMatchCount.toLocaleString() + " matched!", | ||||
|                   barClass: "progress", textClass: "soFarText" }, | ||||
|             ]}); | ||||
|     } else { | ||||
|  |  | |||
		Loading…
	
	Add table
		
		Reference in a new issue
	
	 Brett Smith
						Brett Smith