1
0
mirror of https://github.com/simple-icons/simple-icons.git synced 2025-01-05 01:20:39 +02:00

Added hashchange listener

This commit is contained in:
Dan Leech 2015-10-28 15:53:06 +00:00
parent 90cd897230
commit c150947e4c
3 changed files with 30 additions and 9 deletions

View File

@ -388,9 +388,16 @@
search(); search();
}); });
var query = window.location.hash.substring(1); hashSearch();
document.getElementById("search").value = query; window.addEventListener('hashchange', function (evt) {
search(); hashSearch();
});
function hashSearch() {
var query = window.location.hash.substring(1);
document.getElementById("search").value = query;
search();
}
function search() { function search() {
var searchTerm = searchField.value.toLowerCase(); var searchTerm = searchField.value.toLowerCase();

View File

@ -388,9 +388,16 @@
search(); search();
}); });
var query = window.location.hash.substring(1); hashSearch();
document.getElementById("search").value = query; window.addEventListener('hashchange', function (evt) {
search(); hashSearch();
});
function hashSearch() {
var query = window.location.hash.substring(1);
document.getElementById("search").value = query;
search();
}
function search() { function search() {
var searchTerm = searchField.value.toLowerCase(); var searchTerm = searchField.value.toLowerCase();

View File

@ -11,9 +11,16 @@
search(); search();
}); });
var query = window.location.hash.substring(1); hashSearch();
document.getElementById("search").value = query; window.addEventListener('hashchange', function (evt) {
search(); hashSearch();
});
function hashSearch() {
var query = window.location.hash.substring(1);
document.getElementById("search").value = query;
search();
}
function search() { function search() {
var searchTerm = searchField.value.toLowerCase(); var searchTerm = searchField.value.toLowerCase();