Skip to content

Commit d9a3cfc

Browse files
committed
add: completed selectDifficulty function
1 parent 2037981 commit d9a3cfc

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

options/difficulyDropdown.js

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -77,11 +77,15 @@ class DifficultyDropdown {
7777
}
7878

7979
selectDifficulty(difficulty) {
80-
// TODO: Finish function
80+
this.selectedDifficulty = difficulty;
81+
82+
const textSpan = this.selected.querySelector('.difficulty-dropdown-selected-text');
83+
if (textSpan) textSpan.textContent = difficulty === 'all' ? 'All Difficulties' : difficulty;
84+
this.closeList();
8185
}
8286

8387
toggleList() {
84-
// TODO: Finish function
88+
8589
}
8690

8791
closeList() {
@@ -93,4 +97,4 @@ class DifficultyDropdown {
9397
}
9498

9599
}
96-
window.DifficultyDropdown = DifficultyDropdown;
100+
window.DifficultyDropdown = DifficultyDropdown;

0 commit comments

Comments
 (0)