Commit 77e933d93d342c7481e197fae9461cb8d0c8ecb1

Fix filterTags function

  - The previous implementation of filterTags was not working. Fix that.
  
256256 }, this);
257257
258258 // pluck uniq tags of sweets
259 var tags = _.chain(this.collection.pluck('how')).pluck('tags').uniq().
260 value();
259 var tags = _.chain(this.collection.pluck('how')).pluck('tags').flatten().
260 uniq().value();
261261 // render them as filter controls
262262 _.each(tags, function(tag) {
263263 if(tag) {
308308 return;
309309 }
310310 var filtered_swts = this.collection.filter(function(model) {
311 //TODO: find a better way of doing this..
312 var flag = false;
311313 _.each(model.get('how').tags, function(tag) {
312314 if(_.indexOf(tags, tag) > -1) {
313 return model;
315 flag = true;
314316 }
315317 });
318 if(flag === true) {
319 return model;
320 }
316321 });
317322 if(filtered_swts.length) {
318323 anno.removeAll();