mirror of
				https://github.com/searxng/searxng.git
				synced 2025-10-31 10:37:06 -04:00 
			
		
		
		
	Merge pull request #2006 from kvch/fix-search-on-category-select-considet-method
Consider HTTP request when running search categories on select is ena…
This commit is contained in:
		
						commit
						c83007a6bc
					
				| @ -6,19 +6,37 @@ $(document).ready(function() { | |||||||
|             }); |             }); | ||||||
|             $(document.getElementById($(this).attr("for"))).prop('checked', true); |             $(document.getElementById($(this).attr("for"))).prop('checked', true); | ||||||
|             if($('#q').val()) { |             if($('#q').val()) { | ||||||
|  |                 if (getHttpRequest() == "GET") { | ||||||
|  |                     $('#search_form').attr('action', $('#search_form').serialize()); | ||||||
|  |                 } | ||||||
|                 $('#search_form').submit(); |                 $('#search_form').submit(); | ||||||
|             } |             } | ||||||
|             return false; |             return false; | ||||||
|         }); |         }); | ||||||
|         $('#time-range').change(function(e) { |         $('#time-range').change(function(e) { | ||||||
|             if($('#q').val()) { |             if($('#q').val()) { | ||||||
|  |                 if (getHttpRequest() == "GET") { | ||||||
|  |                     $('#search_form').attr('action', $('#search_form').serialize()); | ||||||
|  |                 } | ||||||
|                 $('#search_form').submit(); |                 $('#search_form').submit(); | ||||||
|             } |             } | ||||||
|         }); |         }); | ||||||
|         $('#language').change(function(e) { |         $('#language').change(function(e) { | ||||||
|             if($('#q').val()) { |             if($('#q').val()) { | ||||||
|  |                 if (getHttpRequest() == "GET") { | ||||||
|  |                     $('#search_form').attr('action', $('#search_form').serialize()); | ||||||
|  |                 } | ||||||
|                 $('#search_form').submit(); |                 $('#search_form').submit(); | ||||||
|             } |             } | ||||||
|         }); |         }); | ||||||
|     } |     } | ||||||
| }); | }); | ||||||
|  | 
 | ||||||
|  | function getHttpRequest() { | ||||||
|  |     httpRequest = "POST"; | ||||||
|  |     urlParams = new URLSearchParams(window.location.search); | ||||||
|  |     if (urlParams.has('method')) { | ||||||
|  |         httpRequest = urlParams.get('method'); | ||||||
|  |     } | ||||||
|  |     return httpRequest; | ||||||
|  | } | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user