mirror of
				https://git.sr.ht/~cadence/bibliogram
				synced 2025-10-31 03:25:36 +00:00 
			
		
		
		
	Fix post navigation button functionality
This commit is contained in:
		
							parent
							
								
									74f731ceea
								
							
						
					
					
						commit
						a861df2662
					
				| @ -148,11 +148,11 @@ function loadPostOverlay(shortcode, stateChangeType) { | |||||||
| 				overlay.element.querySelectorAll(".navigate-posts").forEach(button => { | 				overlay.element.querySelectorAll(".navigate-posts").forEach(button => { | ||||||
| 					button.addEventListener("click", async event => { | 					button.addEventListener("click", async event => { | ||||||
| 						/** @type {HTMLButtonElement} */ | 						/** @type {HTMLButtonElement} */ | ||||||
| 						//@ts-ignore
 | 						// @ts-ignore
 | ||||||
| 						const button = event.currentTarget | 						const button = event.currentTarget | ||||||
| 						if (button.classList.contains("next")) { | 						if (button.hasAttribute("data-next")) { | ||||||
| 							navigate("next") | 							navigate("next") | ||||||
| 						} else { | 						} else if (button.hasAttribute("data-previous")) { | ||||||
| 							navigate("previous") | 							navigate("previous") | ||||||
| 						} | 						} | ||||||
| 					}) | 					}) | ||||||
|  | |||||||
| @ -12,9 +12,9 @@ mixin post(post, headerWithNavigation) | |||||||
| 						else | 						else | ||||||
| 							= `@${post.getBasicOwner().username}` | 							= `@${post.getBasicOwner().username}` | ||||||
| 				if headerWithNavigation | 				if headerWithNavigation | ||||||
| 					button.navigate-posts | 					button(data-previous).navigate-posts | ||||||
| 						img(src="/static/img/arrow-circled.svg" alt="Previous post.").icon.previous | 						img(src="/static/img/arrow-circled.svg" alt="Previous post.").icon.previous | ||||||
| 					button.navigate-posts | 					button(data-next).navigate-posts | ||||||
| 						img(src="/static/img/arrow-circled.svg" alt="Next post.").icon | 						img(src="/static/img/arrow-circled.svg" alt="Next post.").icon | ||||||
| 			div.relative-box | 			div.relative-box | ||||||
| 				div.scrolling-box | 				div.scrolling-box | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user