MOBILE-2501 course: Retrieve section number from hash in course links
This commit is contained in:
		
							parent
							
								
									e6c5607463
								
							
						
					
					
						commit
						fc9835b035
					
				@ -58,6 +58,14 @@ export class CoreCoursesCourseLinkHandler extends CoreContentLinksHandlerBase {
 | 
				
			|||||||
                sectionId: sectionId || null
 | 
					                sectionId: sectionId || null
 | 
				
			||||||
            };
 | 
					            };
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        if (!sectionId && !sectionNumber) {
 | 
				
			||||||
 | 
					            // Check if the URL has a hash to navigate to the section.
 | 
				
			||||||
 | 
					            const matches = url.match(/#section-(\d+)/);
 | 
				
			||||||
 | 
					            if (matches && matches[1]) {
 | 
				
			||||||
 | 
					                sectionNumber = parseInt(matches[1], 10);
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        if (!isNaN(sectionNumber)) {
 | 
					        if (!isNaN(sectionNumber)) {
 | 
				
			||||||
            pageParams.sectionNumber = sectionNumber;
 | 
					            pageParams.sectionNumber = sectionNumber;
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user