Update search.js
This commit is contained in:
parent
66c11808b2
commit
648538b5cc
1 changed files with 5 additions and 2 deletions
|
|
@ -52,13 +52,16 @@
|
|||
})
|
||||
|
||||
function hashSearch() {
|
||||
if (window.location.hash && window.location.hash.indexOf('#search=') === 0) {
|
||||
search.input.autocomplete.setVal(window.location.hash.slice(8))
|
||||
var SEARCH_WORD = '#search='
|
||||
|
||||
if (window.location.hash && window.location.hash.startsWith(SEARCH_WORD)) {
|
||||
search.input.autocomplete.setVal(window.location.hash.slice(SEARCH_WORD.length))
|
||||
search.input.autocomplete.open()
|
||||
}
|
||||
}
|
||||
|
||||
hashSearch()
|
||||
|
||||
// For the nerds: search by changing the url hash
|
||||
window.addEventListener('hashchange', hashSearch, false)
|
||||
})()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue