summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoremkael <emkael@tlen.pl>2017-04-12 23:57:28 +0200
committeremkael <emkael@tlen.pl>2017-04-12 23:57:28 +0200
commitbfd1a3d553ce8798e1d4d8e7ce887e7a75f06875 (patch)
treeee1b8fc2d040205ef34f09b7fc6d5bfc910846f3
parentceb0e125f1ba6a0cf22af44df409953d075707c2 (diff)
Filtering age categories on page load fixed
-rw-r--r--http/res/ranking.js9
1 files changed, 5 insertions, 4 deletions
diff --git a/http/res/ranking.js b/http/res/ranking.js
index c21c7c7..10ff469 100644
--- a/http/res/ranking.js
+++ b/http/res/ranking.js
@@ -74,7 +74,7 @@ var ranking = {
allParams.forEach(function(param) {
var newParam = params.get(param) || [];
var oldParam = ranking.savedParams.get(param) || [];
- if (newParam.join(',') != oldParam.join(',')) {
+ if (newParam.length != oldParam.length || newParam.join(',') != oldParam.join(',')) {
paramsChanged = true;
}
});
@@ -169,12 +169,14 @@ var ranking = {
$('.container .table tbody tr').click(ranking.playerClick);
$(document).ready(function() {
- $(window).on('hashchange', ranking.readHash).trigger('hashchange');
+ $(window).on('hashchange', function() {
+ $('table.table-paginate').paginate('clear');
+ ranking.readHash();
+ }).trigger('hashchange');
});
$('button[data-filter]').click(function() {
$('table.table').css('opacity', 0.1);
- $('table.table-paginate').paginate('clear');
var button = $(this);
var params = ranking.parseHash(location.hash);
var param = params.get(button.attr('data-filter'));
@@ -199,7 +201,6 @@ var ranking = {
$('button[data-clear]').click(function() {
$('table.table').css('opacity', 0.1);
- $('table.table-paginate').paginate('clear');
var button = $(this);
var params = ranking.parseHash(location.hash);
params.delete(button.attr('data-clear'));