Skip to content

Commit

Permalink
fix render methods
Browse files Browse the repository at this point in the history
  • Loading branch information
szymonSys committed Sep 17, 2019
1 parent 46557ee commit 3e56fbd
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Game.js
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@ class Game {
}

checkIfWin() {
return this.numberOfMatchedSqueres === 2 ? true : false;
// return this.numberOfMatchedSqueres === 2 ? true : false;
return this.numberOfMatchedSqueres === this.numberOfSquares ? true : false;
}
}
2 changes: 1 addition & 1 deletion Grid.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class Grid {
elem.dataset.isActive = square.isActive.toString();
elem.dataset.isMatched = square.isMatched.toString();
elem.style.backgroundColor = square.color;
elem.textContent = square.value;
// elem.textContent = square.value;

wrapper.appendChild(elem);
}
Expand Down
1 change: 1 addition & 0 deletions Result.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ class Result {
this._actions = actions;
this._playerName = playerName ? playerName : 'anonim';
this._timeValue = timeValue;
this._difficulty = difficulty;
}

get time() {
Expand Down
4 changes: 2 additions & 2 deletions Table.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class Table {
playerName: "result-name",
time: "result-time",
actions: "result-counter",
timeValue: "timeValue",
timeValue: "time-value",
difficulty: "result-difficulty"
},
style: {
Expand Down Expand Up @@ -171,8 +171,8 @@ class Table {
// result.dataset.timeValue = result.timeValue;

for (const id in this.resultElementProps.typeId) {
if (id === 'timeValue') continue;
result.dataset[id] = id === 'number' ? i + 1 : this.rankTable[i][id];
if (id === 'timeValue') continue;
result.innerHTML += `<div id="${this.resultElementProps.typeId[id]}" style = "${this.resultElementProps.childWidth}" class="${this.resultElementProps.typeClass}">
<span>${id === 'number' ? i+1 : this.rankTable[i][id]}</span>
</div>`;
Expand Down

0 comments on commit 3e56fbd

Please sign in to comment.