Commit 77035e5910570998bca008a4859f1ad63bf03256
Reset anno object when a user clicks on any entry in linked-data
| | | | 722 | this.render(); | 722 | this.render(); |
---|
723 | }, | 723 | }, |
---|
724 | userTagClicked: function(e) { | 724 | userTagClicked: function(e) { |
---|
| | 725 | anno.reset(); |
---|
725 | var user = $(e.currentTarget).text(); | 726 | var user = $(e.currentTarget).text(); |
---|
726 | var swts = swtr.LDs.filter(function(swt) { | 727 | var swts = swtr.LDs.filter(function(swt) { |
---|
727 | if(swt.get('who') == user) { | 728 | if(swt.get('who') == user) { |
---|
728 | return swt; | 729 | return swt; |
---|
729 | } | 730 | } |
---|
730 | }); | 731 | }); |
---|
731 | swts = _.uniq(swts,'how'.src); | | swts = _.uniq(swts,'how'.src); |
---|
| | 732 | swts = _.uniq(swts, function(swt) { | | | 733 | return swt.get('where'); |
---|
| | 734 | }); |
---|
732 | this.setGalleryView(swts); | 735 | this.setGalleryView(swts); |
---|
733 | // $(this.el).hide(); | 736 | // $(this.el).hide(); |
---|
734 | }, | 737 | }, |
---|
735 | tagsTagClicked: function(e) { | 738 | tagsTagClicked: function(e) { |
---|
| | 739 | anno.reset(); |
---|
736 | var tag = $(e.currentTarget).text(); | 740 | var tag = $(e.currentTarget).text(); |
---|
737 | var swts = swtr.LDs.filter(function(swt) { | 741 | var swts = swtr.LDs.filter(function(swt) { |
---|
738 | if(swt.get('how').tags){ | 742 | if(swt.get('how').tags){ |
---|
… | | … | |
---|
745 | } | 745 | } |
---|
746 | } | 746 | } |
---|
747 | }); | 747 | }); |
---|
748 | this.setGalleryView(swts); | | this.setGalleryView(swts); |
---|
| | 748 | swts = _.uniq(swts, function(swt) { | | | 749 | return swt.get('where'); |
---|
| | 750 | }); |
---|
| | 751 | |
---|
| | 752 | this.setGalleryView(_.uniq(swts, 'where')); |
---|
749 | // $(this.el).hide(); | 753 | // $(this.el).hide(); |
---|
750 | }, | 754 | }, |
---|
751 | setGalleryView: function(swts) { | 755 | setGalleryView: function(swts) { |
---|