Skip to content

Commit e5a3fdc

Browse files
committed
add: finished createDropdown function
- need to finish implementation of all the other functions
1 parent e32aebf commit e5a3fdc

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

options/difficulyDropdown.js

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,24 @@ class DifficultyDropdown {
3131
this.dropdown.appendChild(this.selected);
3232

3333
this.list = document.createElement('div');
34+
this.list.className = 'difficulty-dropdown-list'
35+
this.list.style.display = 'none'
36+
37+
this.optionsContainer = document.createElement('div');
38+
this.optionsContainer.className = 'difficulty-dropdown-options';
39+
this.list.appendChild(this.optionsContainer);
40+
41+
this.dropdown.appendChild(this.list);
42+
this.container.appendChild(this.dropdown);
43+
44+
this.renderOptions();
45+
document.addEventListener('click', (e) => {
46+
if (!this.dropdown.contains(e.target)) this.closeList();
47+
});
3448
}
3549

3650
renderOptions() {
37-
// TODO: Finish function
51+
3852
}
3953

4054
filterDifficulties() {

0 commit comments

Comments
 (0)