Fix station search bug
When writing "cala" in order to search for "Călărași", it wouldn't work because only the first ă was replaced with a.
This commit is contained in:
		
							parent
							
								
									6e4b6a609a
								
							
						
					
					
						commit
						1fb1153f13
					
				
					 1 changed files with 5 additions and 5 deletions
				
			
		
							
								
								
									
										10
									
								
								station.js
									
										
									
									
									
								
							
							
						
						
									
										10
									
								
								station.js
									
										
									
									
									
								
							| 
						 | 
				
			
			@ -11,11 +11,11 @@ function goToStation(station) {
 | 
			
		|||
function searchNormalize(str) {
 | 
			
		||||
	return str
 | 
			
		||||
		.toLowerCase()
 | 
			
		||||
		.replace('ă', 'a')
 | 
			
		||||
		.replace('â', 'a')
 | 
			
		||||
		.replace('î', 'i')
 | 
			
		||||
		.replace('ș', 's')
 | 
			
		||||
		.replace('ț', 't')
 | 
			
		||||
		.replaceAll('ă', 'a')
 | 
			
		||||
		.replaceAll('â', 'a')
 | 
			
		||||
		.replaceAll('î', 'i')
 | 
			
		||||
		.replaceAll('ș', 's')
 | 
			
		||||
		.replaceAll('ț', 't')
 | 
			
		||||
} 
 | 
			
		||||
 | 
			
		||||
var focusedElement = null
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		
		Reference in a new issue