@@ -55,20 +55,6 @@ $(function() {
5555 }
5656 }
5757
58- // Initialize state for Framework and Tfm checkboxes
59- // NOTE: We first click on all selected Framework checkboxes and then on the selected Tfm checkboxes, which
60- // allows us to correctly handle cases where a Framework AND one of its child Tfms is present in the query
61- initializeFrameworkAndTfmCheckboxes ( ) ;
62- function initializeFrameworkAndTfmCheckboxes ( ) {
63- var inputFrameworkFilters = searchForm . frameworks . value . split ( ',' ) . map ( f => f . trim ( ) ) . filter ( f => f ) ;
64- var inputTfmFilters = searchForm . tfms . value . split ( ',' ) . map ( f => f . trim ( ) ) . filter ( f => f ) ;
65- searchForm . frameworks . value = "" ;
66- searchForm . tfms . value = "" ;
67-
68- inputFrameworkFilters . map ( id => document . getElementById ( id ) ) . forEach ( checkbox => checkbox . click ( ) ) ;
69- inputTfmFilters . map ( id => document . getElementById ( id ) ) . forEach ( checkbox => checkbox . click ( ) ) ;
70- }
71-
7258 // Submit the form when a user changes the selected 'sortBy' option
7359 searchForm . sortby . addEventListener ( 'change' , ( e ) => {
7460 searchForm . sortby . value = e . target . value ;
@@ -108,4 +94,18 @@ $(function() {
10894 }
10995 }
11096 }
97+
98+ // Initialize state for Framework and Tfm checkboxes
99+ // NOTE: We first click on all selected Framework checkboxes and then on the selected Tfm checkboxes, which
100+ // allows us to correctly handle cases where a Framework AND one of its child Tfms is present in the query
101+ initializeFrameworkAndTfmCheckboxes ( ) ;
102+ function initializeFrameworkAndTfmCheckboxes ( ) {
103+ var inputFrameworkFilters = searchForm . frameworks . value . split ( ',' ) . map ( f => f . trim ( ) ) . filter ( f => f ) ;
104+ var inputTfmFilters = searchForm . tfms . value . split ( ',' ) . map ( f => f . trim ( ) ) . filter ( f => f ) ;
105+ searchForm . frameworks . value = "" ;
106+ searchForm . tfms . value = "" ;
107+
108+ inputFrameworkFilters . map ( id => document . getElementById ( id ) ) . forEach ( checkbox => checkbox . click ( ) ) ;
109+ inputTfmFilters . map ( id => document . getElementById ( id ) ) . forEach ( checkbox => checkbox . click ( ) ) ;
110+ }
111111} ) ;
0 commit comments