File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -139,24 +139,12 @@ function createComponent(html) {
139139 * @param {event } event - User event
140140 */
141141 function handleResultDropdown ( event ) {
142- const button = event . target ;
143- const parent = button . parentElement ;
144- const grandparent = parent . parentElement ;
145- let arrow ;
146- let description ;
147-
148- // Check if user clicked on button - assign variables
149- if ( button . classList . contains ( 'cordion' ) ) {
150- arrow = button . firstChild ;
151- description = parent . nextElementSibling ;
152- // If user clicked on icon, change variable assignment
153- } else {
154- arrow = button ;
155- description = grandparent . nextElementSibling ;
156- }
142+ const button = event . currentTarget ;
143+ const arrow = button . firstChild ;
144+ const desc = button . parentElement . nextElementSibling ;
157145 // Rotate arrow and display/hide result description
158146 arrow . classList . toggle ( 'rotArrow' ) ;
159- description . classList . toggle ( 'search_content_drop' ) ;
147+ desc . classList . toggle ( 'search_content_drop' ) ;
160148 }
161149 }
162150 }
You can’t perform that action at this time.
0 commit comments