Commit efa5ac15621e79b2f6b83b0d77f50b5c44f2df50

  • avatar
  • arvind
  • Tue Sep 09 19:17:51 IST 2014
Show the annotations of a image in the linked-data area, under the
gallery view.
  • Diff rendering mode:
  • inline
  • side by side

swtr/static/js/main.js

786786
787 var GalleryView = Backbone.View.extend({787 var GalleryView = Backbone.View.extend({
788 el: $("#gallery"),788 el: $("#gallery"),
789 events: {
790 "click img":"onImgClick"
791 },
789 initialize: function() {792 initialize: function() {
790 this.template = _.template($("#gallery-item-template").html());793 this.template = _.template($("#gallery-item-template").html());
794 this.cover_template = _.template($("#ocd-item-cover-template").html());
791 this.render();795 this.render();
792 },796 },
793 render: function() {797 render: function() {
811 }811 }
812 $(this.el).html('');812 $(this.el).html('');
813813
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 });
816830