Commit 592087c1 authored by alexandre's avatar alexandre

Fix tag update

parent 5dfb290d
......@@ -1035,6 +1035,17 @@ window.W = window.W || {};
}
this.listenTo(this.model, 'change', this.render);
this.listenTo(this.model.get('sublines'), 'change:tag', this.updateTag);
},
updateTag: function() {
var $el = this.$el.find(".sublines__metadata");
var tag = this.model.get('sublines').first().get('tag');
$el.get(0).dataset.tag = tag;
$el.find(".tag").get(0).dataset.tag = tag;
},
/**
......@@ -2333,7 +2344,6 @@ window.W = window.W || {};
var that = this;
options.syncWith.listenTo(this, 'filter', function(view, event, options) {
console.log(view);
var action = that.collection.action;
if (this.queryParams[action] && action == "tags") {
......@@ -2422,7 +2432,6 @@ window.W = window.W || {};
},
onSortByTitle: function() {
console.log("ok");
this.collection.state.sortKey = "title";
this.collection.fetch();
// this.collection.setSorting("title");
......@@ -2431,7 +2440,6 @@ window.W = window.W || {};
},
onSortByDate: function() {
console.log("ok");
this.collection.state.sortKey = "-created_at";
this.collection.fetch();
// this.collection.setSorting("-created_at");
......
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