Subversion Repositories SmartDukaan

Rev

Rev 25671 | Rev 25673 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 25671 Rev 25672
Line 887... Line 887...
887
		    message: '<div class="container text-center"><i class="fa fa-spin fa-spinner"></i>Loading...</div>',
887
		    message: '<div class="container text-center"><i class="fa fa-spin fa-spinner"></i>Loading...</div>',
888
		    show: false	
888
		    show: false	
889
		});
889
		});
890
		starTotal = 5;
890
		starTotal = 5;
891
		ratings = {
891
		ratings = {
892
			current : $currentMonthRating,
892
			current : Math.round($currentMonthRating*10)/10,
893
			last: $lastMonthRating,
893
			last: Math.round($lastMonthRating*10)/10,
894
			tilldate: $ratingTillDate
894
			tilldate: Math.round($ratingTillDate*10)/10
895
		}; 
895
		}; 
896
		for(const rating in ratings) {  
896
		for(const rating in ratings) {  
897
		  // 2
897
		  // 2
898
		  const starPercentage = (ratings[rating] / starTotal) * 100;
898
		  const starPercentage = (ratings[rating] / starTotal) * 100;
899
		  // 3
899
		  // 3
900
		  const starPercentageRounded = `${(Math.round(starPercentage * 10) / 10)}%`;
900
		  const starPercentageRounded = `${(Math.round(starPercentage / 10) * 10)}%`;
901
		  // 4
901
		  // 4
902
		  document.querySelector(`.${rating} .stars-inner`).style.width = starPercentageRounded; 
902
		  document.querySelector(`.${rating} .stars-inner`).style.width = starPercentageRounded; 
903
		}
903
		}
904
	});
904
	});
905
	
905