File tree Expand file tree Collapse file tree 1 file changed +15
-1
lines changed
Expand file tree Collapse file tree 1 file changed +15
-1
lines changed Original file line number Diff line number Diff 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 ( ) {
You can’t perform that action at this time.
0 commit comments