mirror of
				https://github.com/privacyguides/privacyguides.org.git
				synced 2025-10-31 03:26:35 +00:00 
			
		
		
		
	Fix collapsing navbar dropdown when clicking another element (#1552)
JavaScript was checking if element clicked is exactly .nav-summary, which isn't a problem when just clicking text inside it, but if we try to click another element inside like <span>, it won't work, since now this span is clicked, not .nav-summary. Closes #1549
This commit is contained in:
		| @@ -25,7 +25,11 @@ function navSectionsToggle() { | ||||
|  | ||||
| function navSectionsClose(event) { | ||||
|   // Hide all dropdowns when clicking in different place | ||||
|   if (event.target.matches(".nav-summary")) return; | ||||
|   if ( | ||||
|     event.target.matches(".nav-summary") || | ||||
|     event.target.parentNode.matches(".nav-summary") | ||||
|   ) | ||||
|     return; | ||||
|   navSections.forEach(navSection => { | ||||
|     navSection.open = !open; | ||||
|   }); | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Dawid Potocki
					Dawid Potocki