mirror of
				https://github.com/go-gitea/gitea
				synced 2025-10-31 11:28:24 +00:00 
			
		
		
		
	Fix mobile navbar and misc cleanups (#25134)
- Fix and improve mobile navbar layout - Apply all cleanups suggested in https://github.com/go-gitea/gitea/pull/25111 - Make media query breakpoints match Fomantic's exactly - Clean up whitespace in class on navbar items Mobile navbar before and after: <img width="745" alt="Screenshot 2023-06-08 at 08 40 56" src="https://github.com/go-gitea/gitea/assets/115237/ca84b239-b10f-41db-8c06-dcf2b6dd9d28"> <img width="739" alt="Screenshot 2023-06-08 at 08 41 23" src="https://github.com/go-gitea/gitea/assets/115237/09133c54-eb7e-4110-858c-ead23c3b7521"> --------- Co-authored-by: wxiaoguang <wxiaoguang@gmail.com> Co-authored-by: Giteabot <teabot@gitea.io>
This commit is contained in:
		| @@ -20,18 +20,14 @@ export function initGlobalFormDirtyLeaveConfirm() { | ||||
| } | ||||
|  | ||||
| export function initHeadNavbarContentToggle() { | ||||
|   const content = $('#navbar'); | ||||
|   const toggle = $('#navbar-expand-toggle'); | ||||
|   let isExpanded = false; | ||||
|   toggle.on('click', () => { | ||||
|     isExpanded = !isExpanded; | ||||
|     if (isExpanded) { | ||||
|       content.addClass('shown'); | ||||
|       toggle.addClass('active'); | ||||
|     } else { | ||||
|       content.removeClass('shown'); | ||||
|       toggle.removeClass('active'); | ||||
|     } | ||||
|   const navbar = document.getElementById('navbar'); | ||||
|   const btn = document.getElementById('navbar-expand-toggle'); | ||||
|   if (!navbar || !btn) return; | ||||
|  | ||||
|   btn.addEventListener('click', () => { | ||||
|     const isExpanded = btn.classList.contains('active'); | ||||
|     navbar.classList.toggle('navbar-menu-open', !isExpanded); | ||||
|     btn.classList.toggle('active', !isExpanded); | ||||
|   }); | ||||
| } | ||||
|  | ||||
|   | ||||
		Reference in New Issue
	
	Block a user