From b5e65154dd9e2455a36d3a561ecbbeb483a1add9 Mon Sep 17 00:00:00 2001 From: Bhanu Date: Mon, 10 Mar 2014 19:45:48 +0530 Subject: [PATCH] Check box option to Show/Hide selection box from Image Anno --- swtr/static/js/swtmaker.js | 17 ++++++++++++++--- swtr/templates/index.html | 1 + 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/swtr/static/js/swtmaker.js b/swtr/static/js/swtmaker.js index 03db282..4cde857 100644 --- a/swtr/static/js/swtmaker.js +++ b/swtr/static/js/swtmaker.js @@ -177,7 +177,8 @@ events: { 'click #img-url-submit': 'setImage', 'click #sweet': 'sweet', - 'click #signin-credentials': 'getSignInCredentials' + 'click #signin-credentials': 'getSignInCredentials', + 'click #setbox': 'showHide' }, initialize: function() { //var allElements = $('body *'); @@ -189,8 +190,8 @@ anno.hideAnnotations();}); anno.addHandler('onSelectionCompleted', function(annotation) { anno.showAnnotations(); }); - anno.addHandler('onEditorShown', function(annotation) { - anno.hideAnnotations();} ); + + this.$overlay = $('#app-overlay'); this.$img = $('#annotatable-img'); this.imgURL = this.$img.attr('src'); @@ -202,6 +203,16 @@ this.helpview.step(1); } }, + showHide: function() { + if($("input:checked").length) { + $('.annotorious-item-unfocus').css("opacity", "0.5"); + } + else { + $('.annotorious-item-unfocus').css("opacity", "0"); + } + + }, + setImage: function() { anno.reset(); this.imgURL = $('#img-url-input').val(); diff --git a/swtr/templates/index.html b/swtr/templates/index.html index 38cf9e8..dd8a351 100644 --- a/swtr/templates/index.html +++ b/swtr/templates/index.html @@ -31,6 +31,7 @@ + Show/Hide Box
{% if url %} -- 1.7.10.4