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
1 changed files with 5 additions and 6 deletions

View File

@ -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()
})
</script>
</body>
</html>