|
|
@@ -953,8 +953,8 @@ controller = {
|
|
|
if(!menu.classList.contains("menuMinimized")){
|
|
|
menu.classList = "menu menuMinimized";
|
|
|
|
|
|
- for(let button of buttons){
|
|
|
- button.children[1].style.display = "none";
|
|
|
+ for(let i = 0; i < buttons.length; i++){
|
|
|
+ buttons[i].children[1].style.display = "none";
|
|
|
}
|
|
|
|
|
|
document.getElementById("max").style.display = "none";
|
|
|
@@ -964,8 +964,8 @@ controller = {
|
|
|
}else if(menu.classList.contains("menuMinimized")){
|
|
|
menu.classList = "menu";
|
|
|
|
|
|
- for(let button of buttons){
|
|
|
- button.children[1].style.display = "block";
|
|
|
+ for(let i = 0; i < buttons.length; i++){
|
|
|
+ buttons[i].children[1].style.display = "block";
|
|
|
}
|
|
|
|
|
|
setTimeout(()=>{
|
|
|
@@ -1864,15 +1864,15 @@ module.exports = {
|
|
|
ingredientsSelect.removeChild(ingredientsSelect.firstChild);
|
|
|
}
|
|
|
|
|
|
- for(let category of categories){
|
|
|
+ for(let i = 0; i < categories.length; i++){
|
|
|
let optgroup = document.createElement("optgroup");
|
|
|
- optgroup.label = category.name;
|
|
|
+ optgroup.label = categories[i].name;
|
|
|
ingredientsSelect.appendChild(optgroup);
|
|
|
|
|
|
- for(let ingredient of category.ingredients){
|
|
|
+ for(let j = 0; j < categories[i].ingredients.length; j++){
|
|
|
let option = document.createElement("option");
|
|
|
- option.value = ingredient.ingredient.id;
|
|
|
- option.innerText = `${ingredient.ingredient.name} (${ingredient.ingredient.unit})`;
|
|
|
+ option.value = categories[i].ingredients[j].ingredient.id;
|
|
|
+ option.innerText = `${categories[i].ingredients[j].ingredient.name} (${categories[i].ingredients[j].ingredient.unit})`;
|
|
|
optgroup.appendChild(option);
|
|
|
}
|
|
|
}
|
|
|
@@ -2881,9 +2881,9 @@ class LineGraph{
|
|
|
this.data.push(data);
|
|
|
|
|
|
let isChange = false;
|
|
|
- for(let point of data.set){
|
|
|
- if(point > this.max){
|
|
|
- this.max = point;
|
|
|
+ for(let i = 0; i < data.set.length; i++){
|
|
|
+ if(data.set[i] > this.max){
|
|
|
+ this.max = data.set[i];
|
|
|
this.verticalMultiplier = (this.bottom - this.top) / this.max;
|
|
|
this.horizontalMultiplier = (this.right - this.left) / (data.set.length - 1);
|
|
|
isChange = true;
|
|
|
@@ -2948,8 +2948,8 @@ class LineGraph{
|
|
|
this.drawYAxis();
|
|
|
this.drawXAxis();
|
|
|
|
|
|
- for(let dataSet of this.data){
|
|
|
- this.drawLine(dataSet);
|
|
|
+ for(let i = 0; i < this.data.length; i++){
|
|
|
+ this.drawLine(this.data[i]);
|
|
|
}
|
|
|
|
|
|
if(this.title){
|
|
|
@@ -3085,12 +3085,12 @@ class HorizontalBarGraph{
|
|
|
addData(dataArray){
|
|
|
this.context.clearRect(0, 0, this.canvas.width, this.canvas.height);
|
|
|
|
|
|
- for(let point of dataArray){
|
|
|
- if(point.num > this.max){
|
|
|
- this.max = point.num;
|
|
|
+ for(let i = 0; i < dataArray.length; i++){
|
|
|
+ if(dataArray[i].num > this.max){
|
|
|
+ this.max = dataArray[i].num;
|
|
|
}
|
|
|
|
|
|
- this.data.push(point);
|
|
|
+ this.data.push(dataArray[i]);
|
|
|
}
|
|
|
|
|
|
this.drawGraph();
|