Skip to content

Commit 31bd068

Browse files
committed
add completed closeList, setDifficulty
1 parent d9a3cfc commit 31bd068

File tree

1 file changed

+11
-5
lines changed

1 file changed

+11
-5
lines changed

options/difficulyDropdown.js

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -85,16 +85,22 @@ class DifficultyDropdown {
8585
}
8686

8787
toggleList() {
88-
88+
this.list.style.display = this.list.style.display === 'none' ? 'block' : 'none';
89+
if (this.list.style.display === 'block') {
90+
this.searchInput.value = '';
91+
this.filterTags();
92+
this.searchInput.focus();
93+
}
8994
}
9095

9196
closeList() {
92-
97+
this.list.style.display = 'none';
9398
}
9499

95-
selectDifficulty() {
96-
100+
setDifficulty(difficulties) {
101+
this.difficulties = difficulties;
102+
this.filterDifficulties = ['all', ...difficulties];
103+
this.renderOptions();
97104
}
98-
99105
}
100106
window.DifficultyDropdown = DifficultyDropdown;

0 commit comments

Comments
 (0)