Commit ab0e5ee2 by alexandre

Fixed filters

parent 4650bd83
......@@ -2047,9 +2047,9 @@ window.W = window.W || {};
options.syncWith.listenTo(this, 'filter', function(view, event, options) {
console.log(view);
var action = this.queryParams[that.collection.action];
var action = that.collection.action;
if (action && action == "tags") {
if (this.queryParams[action] && action == "tags") {
this.queryParams[that.collection.action] += "," + $(event.currentTarget).data("value");
} else {
this.queryParams[that.collection.action] = $(event.currentTarget).data("value");
......@@ -2088,7 +2088,6 @@ window.W = window.W || {};
template: '#applied-filters-template',
templateContext: function() {
console.log(this.collection.queryParams);
return {
search: this.collection.queryParams.search,
tags: this.collection.queryParams.tags,
......@@ -2102,10 +2101,6 @@ window.W = window.W || {};
},
onRemove: function(view, event) {
console.log($(event.currentTarget).data("filter"));
console.log($(event.currentTarget).data("value"));
console.log(view.collection.queryParams);
var filter = $(event.currentTarget).data("filter");
delete this.collection.queryParams[filter];
this.collection.getFirstPage();
......
......@@ -4,7 +4,7 @@ Résultats pour: <%- search %>
<% if (language) { %>
<span class="btn-filter" data-filter="language" data-value="<%- language %>"><span class="btn-filter__label"><%- ('Langue') %></span>:<%- language %> [x]</span>
<% } else if (score_type) { %>
<% } if (score_type) { %>
<span class="btn-filter" data-filter="score_type" data-value="<%- score_type %>"><span class="btn-filter__label"><%- ('Type de partition') %></span>:
<% if (score_type === 1) { %>
<%- t('Transcription') %>
......@@ -15,6 +15,6 @@ Résultats pour: <%- search %>
<% } %>
[x]
</span>
<% } else if (tags) { %>
<% } if (tags) { %>
<span class="btn-filter" data-filter="tags" data-value="<%- tags %>"><span class="btn-filter__label"><%- ('Tags') %></span>:<%- tags %> [x]</span>
<% } %>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment