Change hash when filtering, select first after filter

This commit is contained in:
Mu-An Chiou 2015-04-03 13:07:04 +08:00
parent 2dc740a27f
commit 2d30417f38

View File

@ -219,17 +219,16 @@
}) })
$('#theNumberofSpots').html(theNumberofSpots) $('#theNumberofSpots').html(theNumberofSpots)
filterOnHash()
}
window.onhashchange = filterOnHash
function filterOnHash() {
if(window.location.hash) { if(window.location.hash) {
$('#tableFilter').val(window.location.hash.substring(1)).keyup() $('#tableFilter').val(window.location.hash.substring(1)).keyup()
$('.spotRow').first().click() $('.spotRow').first().click()
} }
} }
$(document).on('keyup', '#tableFilter', function() {
window.location.hash = $(this).val()
$('.spotRow').first().click()
})
</script> </script>
</body> </body>
</html> </html>