Commit efa5ac15621e79b2f6b83b0d77f50b5c44f2df50
- Diff rendering mode:
- inline
- side by side
swtr/static/js/main.js
(18 / 0)
  | |||
786 | 786 | ||
787 | 787 | var GalleryView = Backbone.View.extend({ | |
788 | 788 | el: $("#gallery"), | |
789 | events: { | ||
790 | "click img":"onImgClick" | ||
791 | }, | ||
789 | 792 | initialize: function() { | |
790 | 793 | this.template = _.template($("#gallery-item-template").html()); | |
794 | this.cover_template = _.template($("#ocd-item-cover-template").html()); | ||
791 | 795 | this.render(); | |
792 | 796 | }, | |
793 | 797 | render: function() { | |
… | … | ||
811 | 811 | } | |
812 | 812 | $(this.el).html(''); | |
813 | 813 | ||
814 | }, | ||
815 | onImgClick: function(e){ | ||
816 | var swts = swtr.LDs.filter(function(k) { | ||
817 | if(k.get('where') == $(e.currentTarget).attr('src')) { | ||
818 | return k; | ||
819 | } | ||
820 | }); | ||
821 | anno.makeAnnotatable($(e.currentTarget)[0]); | ||
822 | _.each(swts, function(swt) { | ||
823 | var anno_obj = swt.get('how'); | ||
824 | anno_obj['editable'] = false; | ||
825 | anno.addAnnotation(anno_obj); | ||
826 | }); | ||
827 | this.$(".annotorious-item-unfocus").css("opacity", '0.6'); | ||
814 | 828 | } | |
815 | 829 | }); | |
816 | 830 |