summaryrefslogtreecommitdiff
path: root/http/res
diff options
context:
space:
mode:
authoremkael <emkael@tlen.pl>2017-04-13 00:06:50 +0200
committeremkael <emkael@tlen.pl>2017-04-13 00:06:50 +0200
commit8dda3f31a20df59d6748ba78b8bf2683341bcf07 (patch)
tree5901873c825419625014eb76f6aa6e1a7bdca213 /http/res
parentbfd1a3d553ce8798e1d4d8e7ce887e7a75f06875 (diff)
Fixed first three rows highlight with pagination
Diffstat (limited to 'http/res')
-rw-r--r--http/res/ranking.js12
1 files changed, 5 insertions, 7 deletions
diff --git a/http/res/ranking.js b/http/res/ranking.js
index 10ff469..8ad9fec 100644
--- a/http/res/ranking.js
+++ b/http/res/ranking.js
@@ -92,16 +92,17 @@ var ranking = {
}
});
if (paramsChanged) {
+ $('table.table-paginate').paginate('clear');
ranking.filterRows(params);
ranking.savedParams = params;
}
- $('table.table tbody tr:visible').eq(0).addClass('gold');
- $('table.table tbody tr:visible').eq(1).addClass('silver');
- $('table.table tbody tr:visible').eq(2).addClass('bronze');
$('table.table').css('opacity', 1);
var pagesize = 40;
var page = params.get('page') || [0];
var count = $('table.table-paginate').paginate(pagesize, parseInt(page[0]));
+ $('table.table tbody tr[data-paginate-visible=1]').eq(0).addClass('gold');
+ $('table.table tbody tr[data-paginate-visible=1]').eq(1).addClass('silver');
+ $('table.table tbody tr[data-paginate-visible=1]').eq(2).addClass('bronze');
ranking.buildPaginator('#top-paginator', count, pagesize, page[0] || 1);
ranking.buildPaginator('#bottom-paginator', count, pagesize, page[0] || 1);
},
@@ -169,10 +170,7 @@ var ranking = {
$('.container .table tbody tr').click(ranking.playerClick);
$(document).ready(function() {
- $(window).on('hashchange', function() {
- $('table.table-paginate').paginate('clear');
- ranking.readHash();
- }).trigger('hashchange');
+ $(window).on('hashchange', ranking.readHash).trigger('hashchange');
});
$('button[data-filter]').click(function() {