Commit d791bfa1fcf0943ce35de072005af9e0e729944e
- Diff rendering mode:
- inline
- side by side
swtr/static/js/main.js
(17 / 2)
  | |||
675 | 675 | return swt.get('where'); | |
676 | 676 | }); | |
677 | 677 | ||
678 | this.setGalleryView(_.uniq(swts, 'where')); | ||
678 | // this.setGalleryView(_.uniq(swts, 'where')); | ||
679 | this.setGalleryView(swts); | ||
679 | 680 | // $(this.el).hide(); | |
680 | 681 | }, | |
681 | 682 | setGalleryView: function(swts) { | |
… | … | ||
732 | 732 | render: function() { | |
733 | 733 | this.setUp(); | |
734 | 734 | _.each(this.collection, function(model) { | |
735 | $(this.el).append(this.template(model.toJSON())); | ||
735 | var models = swtr.LDs.filter(function(swt) { | ||
736 | if(swt.get('how').src == model.get('how').src) { | ||
737 | return model; | ||
738 | } | ||
739 | }); | ||
740 | var tags = []; | ||
741 | _.each(models, function(model) { | ||
742 | if(model.get('how').tags) { | ||
743 | tags.push(model.get('how').tags); | ||
744 | } | ||
745 | }); | ||
746 | tags = _.flatten(tags); | ||
747 | $(this.el).append(this.template({'how':{'tags': tags, | ||
748 | 'src':model.get('how').src}, | ||
749 | 'who':model.get('who')})); | ||
736 | 750 | }, this); | |
737 | 751 | $('html, body').animate({ | |
738 | 752 | scrollTop: $("#gallery").offset().top |