summaryrefslogtreecommitdiff
path: root/http
diff options
context:
space:
mode:
authoremkael <emkael@tlen.pl>2017-04-12 23:44:37 +0200
committeremkael <emkael@tlen.pl>2017-04-12 23:44:37 +0200
commitceb0e125f1ba6a0cf22af44df409953d075707c2 (patch)
tree060962716e70fe4ad891619377c49170bf2bc9f3 /http
parentef9d80da8e74b003473ab2383d4ba6279b353ebc (diff)
Filter buttons are set on page load
Diffstat (limited to 'http')
-rw-r--r--http/res/ranking.js26
1 files changed, 13 insertions, 13 deletions
diff --git a/http/res/ranking.js b/http/res/ranking.js
index 1d8923c..c21c7c7 100644
--- a/http/res/ranking.js
+++ b/http/res/ranking.js
@@ -78,20 +78,20 @@ var ranking = {
paramsChanged = true;
}
});
- if (paramsChanged) {
- $('button.btn-primary').removeClass('btn-primary');
- params.forEach(function(values, param) {
- values.forEach(function(value) {
- $('button[data-filter="' + param + '"][data-value="' + value + '"]').addClass('btn-primary');
- });
- });
- allParams.forEach(function(param) {
- if ($('button[data-filter="' + param + '"].btn-primary').size() == 0) {
- $('button[data-clear="' + param + '"]').addClass('btn-primary');
- } else {
- $('#filters').collapse();
- }
+ $('button.btn-primary').removeClass('btn-primary');
+ params.forEach(function(values, param) {
+ values.forEach(function(value) {
+ $('button[data-filter="' + param + '"][data-value="' + value + '"]').addClass('btn-primary');
});
+ });
+ allParams.forEach(function(param) {
+ if ($('button[data-filter="' + param + '"].btn-primary').size() == 0) {
+ $('button[data-clear="' + param + '"]').addClass('btn-primary');
+ } else {
+ $('#filters').collapse();
+ }
+ });
+ if (paramsChanged) {
ranking.filterRows(params);
ranking.savedParams = params;
}