✨ feat: provide code to handle the change of selected value in the safe search menu (#210)
This commit is contained in:
parent
b35cb868a6
commit
ea3205226c
1 changed files with 18 additions and 0 deletions
18
public/static/search_area_options.js
Normal file
18
public/static/search_area_options.js
Normal file
|
@ -0,0 +1,18 @@
|
|||
document.addEventListener(
|
||||
'DOMContentLoaded',
|
||||
() => {
|
||||
let url = new URL(window.location)
|
||||
let searchParams = url.searchParams
|
||||
|
||||
let safeSearchLevel = searchParams.get('safesearch')
|
||||
|
||||
if (
|
||||
safeSearchLevel >= 0 &&
|
||||
safeSearchLevel <= 2 &&
|
||||
safeSearchLevel !== null
|
||||
) {
|
||||
document.querySelector('.search_options select').value = safeSearchLevel
|
||||
}
|
||||
},
|
||||
false,
|
||||
)
|
Loading…
Add table
Reference in a new issue