From 2d30417f38099c12bfdfb980f25f130643120f36 Mon Sep 17 00:00:00 2001 From: Mu-An Chiou Date: Fri, 3 Apr 2015 13:07:04 +0800 Subject: [PATCH] Change hash when filtering, select first after filter --- index.html | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/index.html b/index.html index f2ef0cd..392eee9 100644 --- a/index.html +++ b/index.html @@ -219,17 +219,16 @@ }) $('#theNumberofSpots').html(theNumberofSpots) - filterOnHash() - } - - window.onhashchange = filterOnHash - - function filterOnHash() { if(window.location.hash) { $('#tableFilter').val(window.location.hash.substring(1)).keyup() $('.spotRow').first().click() } } + + $(document).on('keyup', '#tableFilter', function() { + window.location.hash = $(this).val() + $('.spotRow').first().click() + })