Commit afab0321506362344a49f5db37ebcdbf94178776

Authored by Nikita Kulshreshtha
1 parent a25f1460

added annotationToolbar open check

400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js
@@ -4186,14 +4186,18 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo @@ -4186,14 +4186,18 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
4186 $('#btnIdentity').addClass('btn-primary'); 4186 $('#btnIdentity').addClass('btn-primary');
4187 4187
4188 // clear canvas before drawing transparency box 4188 // clear canvas before drawing transparency box
4189 - $('#canvas').removeLayers();  
4190 - var paintCanvasObj = document.getElementById("canvasPaint");  
4191 - var ctx = paintCanvasObj.getContext("2d");  
4192 - ctx.clearRect(0, 0, 2277, 3248);  
4193 - var sktch = $('#canvasPaint').sketch();  
4194 - $('#canvasPaint').sketch().actions = [];  
4195 - $("#annotationpaintbrushsize").removeClass("activebtncolor");  
4196 - $("#annotationpainteraser").removeClass("activebtncolor"); 4189 + if ($rootScope.isAnnotationWindowOpen == true){
  4190 + $('#canvas').removeLayers();
  4191 + var paintCanvasObj = document.getElementById("canvasPaint");
  4192 + if (paintCanvasObj != null) {
  4193 + var ctx = paintCanvasObj.getContext("2d");
  4194 + ctx.clearRect(0, 0, 2277, 3248);
  4195 + }
  4196 + var sktch = $('#canvasPaint').sketch();
  4197 + $('#canvasPaint').sketch().actions = [];
  4198 + $("#annotationpaintbrushsize").removeClass("activebtncolor");
  4199 + $("#annotationpainteraser").removeClass("activebtncolor");
  4200 + }
4197 4201
4198 //hide the speechbubble 4202 //hide the speechbubble
4199 4203
@@ -5665,12 +5669,17 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo @@ -5665,12 +5669,17 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
5665 $("#bord").remove(); 5669 $("#bord").remove();
5666 5670
5667 // clear canvas on closing of transparency box 5671 // clear canvas on closing of transparency box
5668 - $('#canvas').removeLayers();  
5669 - var paintCanvasObj = document.getElementById("canvasPaint");  
5670 - var ctx = paintCanvasObj.getContext("2d");  
5671 - ctx.clearRect(0, 0, 2277, 3248);  
5672 - var sktch = $('#canvasPaint').sketch();  
5673 - $('#canvasPaint').sketch().actions = []; 5672 + if ($rootScope.isAnnotationWindowOpen == true) {
  5673 + $('#canvas').removeLayers();
  5674 + var paintCanvasObj = document.getElementById("canvasPaint");
  5675 + if (paintCanvasObj != null) {
  5676 + var ctx = paintCanvasObj.getContext("2d");
  5677 + ctx.clearRect(0, 0, 2277, 3248);
  5678 +
  5679 + var sktch = $('#canvasPaint').sketch();
  5680 + $('#canvasPaint').sketch().actions = [];
  5681 + }
  5682 + }
5674 // $("#annotationpaintbrushsize").removeClass("activebtncolor"); 5683 // $("#annotationpaintbrushsize").removeClass("activebtncolor");
5675 // $("#annotationpainteraser").removeClass("activebtncolor"); 5684 // $("#annotationpainteraser").removeClass("activebtncolor");
5676 5685