Commit 807d21d6c3f6d09fd77972ace9a1cadc367ece08

Authored by Amrita Vishnoi
2 parents 10873ab1 bee21369

Merge branch 'MergingHistoryCodeinDevelop' of http://52.6.196.163/ADAM/AIAHTML5 …

…into Develop-16Jan2017
400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js
... ... @@ -776,15 +776,27 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
776 776 $('#spinner').css('visibility', 'visible');
777 777 $scope.modestyImageInfo = [];
778 778 // annotation toolbar canvas
779   - if ($("#canvasDiv").find("canvas[id='canvasPaint']").length == 0) {
780 779  
781   - var $layerChange = $("#canvasDiv").append('<canvas id="canvasPaint" width="2277" ng-click="FreeStylePaint($event)" height="3248" class="canvas-annotationStyle1"></canvas><canvas id="canvas" width="2277" height="3248" class="canvas-annotationStyle"></canvas>');
782   - $compile($layerChange)($scope);
783   - $scope.BindCanvasDrawingListners();
  780 + //history code
  781 +
  782 + if ($("#canvasDiv").find("canvas[id='canvasPaint']").length == 0) {
  783 + var ATBarHtml = $("#canvasDiv").append('<canvas id="canvasPaint" width="2277" height="3248" ng-click="FreeStylePaint($event)" class="canvas-annotationStyle1"></canvas><canvas id="canvas" ng-click="onDrawingCanvasClick($event)" width="2277" height="3248" class="canvas-annotationStyle"></canvas>');
  784 + $compile(ATBarHtml)($scope);
  785 + $scope.onDrawingCanvasClick();
784 786 // $rootScope.FreeStylePaint();
785 787  
786 788 }
787 789  
  790 + //duplicate code
  791 + //if ($("#canvasDiv").find("canvas[id='canvasPaint']").length == 0) {
  792 +
  793 + // var $layerChange = $("#canvasDiv").append('<canvas id="canvasPaint" width="2277" ng-click="FreeStylePaint($event)" height="3248" class="canvas-annotationStyle1"></canvas><canvas id="canvas" width="2277" height="3248" class="canvas-annotationStyle"></canvas>');
  794 + // $compile($layerChange)($scope);
  795 + // $scope.onDrawingCanvasClick();
  796 + // // $rootScope.FreeStylePaint();
  797 +
  798 + //}
  799 +
788 800  
789 801  
790 802 $scope.terminateCurrentlyRunningWPs();
... ... @@ -2986,6 +2998,15 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
2986 2998  
2987 2999 //$(".com").css("display", "none");
2988 3000 //$("#bord").css({ "width": "0px", "display": "none" });
  3001 +
  3002 + //history maintained issue
  3003 + if ($rootScope.isAnnotaionToolBarDrawingModeActive == false) {
  3004 + $("#sppeachBubble").remove();
  3005 + $("#dot").remove();
  3006 + }
  3007 +
  3008 +
  3009 +
2989 3010 $(".com").remove();
2990 3011 $("#bord").remove();
2991 3012  
... ... @@ -3088,6 +3109,12 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
3088 3109 document.getElementById('sppeachBubble').style.left = (Globe[0].currentX) + 'px';
3089 3110 document.getElementById('sppeachBubble').style.top = (Globe[0].currentY) + 'px';
3090 3111  
  3112 +
  3113 + //history maintained issue
  3114 + if ($rootScope.isAnnotaionToolBarDrawingModeActive == false) { document.getElementById('sppeachBubble').style.zIndex = "100000000000"; }
  3115 +
  3116 +
  3117 +
3091 3118 $('#sppeachBubble').draggable(
3092 3119 {
3093 3120 drag: function (evt) {
... ... @@ -4645,6 +4672,114 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
4645 4672 //}
4646 4673 }
4647 4674  
  4675 + // History Maintained Issue//
  4676 +
  4677 + $rootScope.getAnnotationTextBasedOnSelectedBodyRegion = function (event) {
  4678 +
  4679 +
  4680 + var canvasDiv = document.getElementById('canvasDiv');
  4681 + var verticalScrollPosition = canvasDiv.scrollTop;
  4682 + var horizontlScrollPosition = canvasDiv.scrollLeft;
  4683 +
  4684 +
  4685 + $rootScope.Xaxis = event.pageX - $('#canvasDiv').offset().left + horizontlScrollPosition;
  4686 + $rootScope.Yaxis = event.pageY - $('#canvasDiv').offset().top + verticalScrollPosition;
  4687 +
  4688 +
  4689 + $rootScope.setSelectedBodyRegionData();
  4690 +
  4691 + if ($rootScope.isMirrorBodyRegion == "No") {
  4692 + var maskCanvasId = "imageCanvas" + $rootScope.BRId + "_mci";
  4693 + var maskCanvas = document.getElementById(maskCanvasId);
  4694 + var maskCanvasContext = maskCanvas.getContext("2d");
  4695 + //var canvasDiv = document.getElementById('canvasDiv');
  4696 + //var verticalScrollPosition = canvasDiv.scrollTop;
  4697 + //var horizontlScrollPosition = canvasDiv.scrollLeft;
  4698 + var actulalX = $rootScope.Xaxis;
  4699 + var actualY = $rootScope.Yaxis;
  4700 + var RGBColor = $scope.GetRGBColor(maskCanvasContext, actulalX, actualY, $rootScope.BodyRegionXAxis, $rootScope.BodyRegionYAxis);
  4701 + var annotationText = $scope.GetAnnotationText(parseInt(RGBColor));
  4702 +
  4703 + }
  4704 + else {
  4705 +
  4706 + var maskCanvasId = "imageCanvas" + $rootScope.BRId + "_MR_mci";
  4707 + var maskoffsetval = $('#' + maskCanvasId).offset();
  4708 + var mirrorCanvasX = maskoffsetval.left;
  4709 + //alert(mirrorCanvasX);
  4710 + var mirrorImageCanvas = document.getElementById(maskCanvasId);
  4711 + var mirrorCanvasWidth = mirrorImageCanvas.clientWidth;
  4712 + // alert(mirrorCanvasWidth);
  4713 + var maskCanvas = document.getElementById(maskCanvasId);
  4714 + var maskCanvasContext = maskCanvas.getContext("2d");
  4715 +
  4716 + var distanceXOnMirrorImage = (parseInt(mirrorCanvasX) + parseInt(mirrorCanvasWidth)) - (parseInt(event.pageX) + horizontlScrollPosition);// - 135);
  4717 + var mirrorXOnNormalImage = parseInt(maskCanvasContext.canvas.offsetLeft) + parseInt(distanceXOnMirrorImage);
  4718 + var actulalX = mirrorXOnNormalImage;
  4719 + var actualY = event.pageY + verticalScrollPosition;
  4720 + var pixelData = maskCanvasContext.getImageData(Math.round(actulalX - parseInt(maskCanvasContext.canvas.offsetLeft)), Math.round(actualY - $rootScope.BodyRegionYAxis), 1, 1);
  4721 + pixelData.data[0] = pixelData.data[0] - 9;
  4722 + pixelData.data[1] = pixelData.data[1] - 9;
  4723 + pixelData.data[2] = pixelData.data[2] - 9
  4724 + var Red;
  4725 + var Green;
  4726 + var Blue;
  4727 + var zero = "0";
  4728 + if ((pixelData.data[0]).toString().length != 2) {
  4729 + Red = zero.concat((pixelData.data[0]).toString())
  4730 + }
  4731 + else {
  4732 + Red = (pixelData.data[0]).toString()
  4733 + }
  4734 + if ((pixelData.data[1]).toString().length != 2) {
  4735 + Green = zero.concat((pixelData.data[1]).toString())
  4736 + }
  4737 + else {
  4738 + Green = (pixelData.data[1]).toString()
  4739 + }
  4740 + if ((pixelData.data[2]).toString().length != 2) {
  4741 + Blue = zero.concat((pixelData.data[2]).toString())
  4742 + }
  4743 + else {
  4744 + Blue = (pixelData.data[2]).toString()
  4745 + }
  4746 + var RGBColor = (Red + Green + Blue);
  4747 + // alert(RGBColor);
  4748 + //$rootScope.previousHighlightList.push(RGBColor);
  4749 +
  4750 + }
  4751 +
  4752 + // var maskCanvasId = "imageCanvas" + $rootScope.BRId + "_mci";
  4753 +
  4754 + // alert(annotationText);
  4755 + $scope.MultiLanguageAnnationArray = [];
  4756 + $scope.MultiLanguageAnnationArray.push(annotationText);
  4757 + if (annotationText == "undefined") {
  4758 + }
  4759 + else {
  4760 + $scope.createDynamicSpeechBubble(event, event.pageX + horizontlScrollPosition - $('#canvasDiv').offset().left, event.pageY + verticalScrollPosition - $('#canvasDiv').offset().top, true)
  4761 + }
  4762 +
  4763 +
  4764 + }
  4765 +
  4766 +
  4767 + $rootScope.setSelectedBodyRegionData = function () {
  4768 + var BodyRegionDictionary = $rootScope.BodyRegionCordinatesData;
  4769 +
  4770 + $.each(BodyRegionDictionary, function (index, value) {
  4771 + var bodyRegionRight = parseInt(value.X) + parseInt(value.Width);
  4772 + var bodyRegionBottom = parseInt(value.Y) + parseInt(value.Height);
  4773 + if ($rootScope.Xaxis <= bodyRegionRight && $rootScope.Yaxis <= bodyRegionBottom && value.X <= $rootScope.Xaxis && value.Y <= $rootScope.Yaxis) {
  4774 + $rootScope.BRId = value.bodyRegionId;
  4775 + $rootScope.BodyRegionXAxis = value.X;
  4776 + $rootScope.BodyRegionYAxis = value.Y;
  4777 + $rootScope.isMirrorBodyRegion = value.IsMirror;
  4778 + return false;
  4779 + }
  4780 + });
  4781 + }
  4782 +
4648 4783  
4649 4784  
4650 4785 function resizeCanvas() {
... ... @@ -6892,7 +7027,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
6892 7027  
6893 7028 $("#canvas").css("display", "block");
6894 7029 $("#canvasPaint").css("display", "block");
6895   - $rootScope.BindCanvasDrawingListners();
  7030 + $rootScope.onDrawingCanvasClick();
6896 7031 $rootScope.FreeStylePaint();
6897 7032 });
6898 7033 $scope.mousePs;
... ...
400-SOURCECODE/AIAHTML5.Web/app/controllers/HomeController.js
... ... @@ -198,8 +198,8 @@ AIA.controller(&quot;HomeController&quot;, [&quot;$rootScope&quot;, &quot;Modules&quot;, &quot;$log&quot;, &quot;$location&quot;,
198 198 $rootScope.isAnnotationWindowOpen = true;
199 199 $(".annotationTollbar").css("display", "block");
200 200 $rootScope.$broadcast('annotationToolEvent', true);
201   - $("#canvasPaint").css("display", "none");
202   - $("#canvas").css("display", "none");
  201 + // $("#canvasPaint").css("display", "none");
  202 + // $("#canvas").css("display", "none");
203 203  
204 204 var FontFamilyJson = '~/../content/data/json/settings/fontstyle.json';
205 205 if ($rootScope.isFontFamilyLoaded == false) {
... ... @@ -240,10 +240,11 @@ AIA.controller(&quot;HomeController&quot;, [&quot;$rootScope&quot;, &quot;Modules&quot;, &quot;$log&quot;, &quot;$location&quot;,
240 240  
241 241 $(".annotationTollbar").css("display", "none");
242 242 $rootScope.isAnnotationWindowClose = true;
243   - $("#canvasPaint").css("display", "none");
244   - $("#canvas").css("display", "none");
  243 + // $("#canvasPaint").css("display", "none");
  244 + // $("#canvas").css("display", "none");
245 245 $('.btnCursor').removeClass('activebtncolor');
246 246 $(".btn-annotation").removeClass("activebtncolor");
  247 + $rootScope.isAnnotaionToolBarDrawingModeActive = true;
247 248 }
248 249 $rootScope.CIAnotationIdentifyModeOff = false;
249 250 $rootScope.OnIdentifyClick = function () {
... ... @@ -257,25 +258,31 @@ AIA.controller(&quot;HomeController&quot;, [&quot;$rootScope&quot;, &quot;Modules&quot;, &quot;$log&quot;, &quot;$location&quot;,
257 258 $('.btnCursor').removeClass('activebtncolor');
258 259  
259 260 } else {
260   - $("#canvasPaint").css("display", "none");
261   - $("#canvas").css("display", "none");
  261 + // $("#canvasPaint").css("display", "none");
  262 + // $("#canvas").css("display", "none");
262 263  
263 264 // $("#canvasPaint").css("z-index", "0");
264 265 // $("#canvas").css("z-index", "0");
265 266 $('.btnCursor').removeClass('activebtncolor');
266 267  
267 268 }
  269 +
  270 + $rootScope.isAnnotaionToolBarDrawingModeActive = false;
  271 + $rootScope.switchCanvas();
268 272 }
269 273  
270 274  
271 275  
272 276 $rootScope.DrawingMode = function () {
  277 + //Annotation History
  278 + $rootScope.isAnnotaionToolBarDrawingModeActive = true;
273 279 $("#OnIdentify").removeClass("annotationtoolbartab");
274 280 $("#DrawMode").addClass("annotationtoolbartab");
275 281 $('.btnCursor').addClass('activebtncolor');
276 282 $rootScope.switchCanvas();
277   - $("#canvasPaint").css("display", "block");
278   - $("#canvas").css("display", "block");
  283 +
  284 + // $("#canvasPaint").css("display", "block");
  285 + // $("#canvas").css("display", "block");
279 286  
280 287 }
281 288  
... ... @@ -345,6 +352,7 @@ AIA.controller(&quot;HomeController&quot;, [&quot;$rootScope&quot;, &quot;Modules&quot;, &quot;$log&quot;, &quot;$location&quot;,
345 352 }
346 353  
347 354 $rootScope.paintBrush = function () {
  355 + $rootScope.isAnnotaionToolBarDrawingModeActive = false;
348 356 if ($rootScope.disableAnnotationtoolOnListManager == true) {
349 357 $rootScope.switchCanvas();
350 358 var canvasPaintZindex = $('#canvasPaint').css("z-index"); //x
... ... @@ -361,7 +369,7 @@ AIA.controller(&quot;HomeController&quot;, [&quot;$rootScope&quot;, &quot;Modules&quot;, &quot;$log&quot;, &quot;$location&quot;,
361 369 }
362 370  
363 371 } else {
364   - // debugger;
  372 +
365 373 // $('.btnCursor').addClass('activebtncolor');
366 374 $rootScope.setListManagerZindex = true;
367 375 $("#canvasPaint").css("display", "block");
... ... @@ -456,6 +464,7 @@ AIA.controller(&quot;HomeController&quot;, [&quot;$rootScope&quot;, &quot;Modules&quot;, &quot;$log&quot;, &quot;$location&quot;,
456 464 $('#canvas').css("z-index", y);
457 465 }
458 466 $rootScope.EraseDrawing = function () {
  467 + $rootScope.isAnnotaionToolBarDrawingModeActive = false;
459 468 $rootScope.switchCanvas();
460 469 $rootScope.isEraseToolSelected = true;
461 470 //$rootScope.switchCanvasToPaintCanvas();
... ... @@ -563,47 +572,68 @@ AIA.controller(&quot;HomeController&quot;, [&quot;$rootScope&quot;, &quot;Modules&quot;, &quot;$log&quot;, &quot;$location&quot;,
563 572 x2: x, y2: y,
564 573  
565 574 click: function (layer) {
566   - $rootScope.canvasLayerNameCollection = [];
567   - $rootScope.canvasLayerNameCollection.push(layer.name);
568   - $(canvasId).setLayer(layer.name, {
569   - handle: {
570   - type: 'arc',
571   - fillStyle: '#fff',
572   - strokeStyle: '#c33',
573   - strokeWidth: 2,
574   - radius: 3
575   - }
576   - }).drawLayers();
577   -
578   -
  575 + if ($rootScope.isAnnotaionToolBarDrawingModeActive == true) {
  576 + //jcanvas property
  577 + layer.draggable = true;
  578 + $rootScope.canvasLayerNameCollection = [];
  579 + $rootScope.canvasLayerNameCollection.push(layer.name);
  580 + $(canvasId).setLayer(layer.name, {
  581 + handle: {
  582 + type: 'arc',
  583 + fillStyle: '#fff',
  584 + strokeStyle: '#c33',
  585 + strokeWidth: 2,
  586 + radius: 3
  587 + }
  588 + }).drawLayers();
  589 +
  590 + }
  591 + else {
  592 + //jcanvas property
  593 + layer.draggable = false;
  594 + }
579 595 },
580 596 mouseout: function (layer) {
581   - $rootScope.canvasLayerNameCollection = [];
582   - $(canvasId).setLayer(layer.name, {
583   - handle: {
584   - type: 'arc',
585   - fillStyle: '#fff',
586   - strokeStyle: '#c33',
587   - strokeWidth: 0,
588   - radius: 0
589   - }
590   -
591   - }).drawLayers();
592   -
  597 + if ($rootScope.isAnnotaionToolBarDrawingModeActive == true) {
  598 + //jcanvas property
  599 + layer.draggable = true;
  600 + $rootScope.canvasLayerNameCollection = [];
  601 + $(canvasId).setLayer(layer.name, {
  602 + handle: {
  603 + type: 'arc',
  604 + fillStyle: '#fff',
  605 + strokeStyle: '#c33',
  606 + strokeWidth: 0,
  607 + radius: 0
  608 + }
  609 +
  610 + }).drawLayers();
  611 + }
  612 + else {
  613 + //jcanvas property
  614 + layer.draggable = false;
  615 + }
593 616 },
594 617 mouseover: function (layer) {
595 618  
596   -
597   - $(canvasId).setLayer(layer.name, {
598   - handle: {
599   - type: 'arc',
600   - fillStyle: '#fff',
601   - strokeStyle: '#c33',
602   - strokeWidth: 2,
603   - radius: 3
604   - }
605   - }).drawLayers();
606   -
  619 + if ($rootScope.isAnnotaionToolBarDrawingModeActive == true) {
  620 + //jcanvas property
  621 + layer.draggable = true;
  622 +
  623 + $(canvasId).setLayer(layer.name, {
  624 + handle: {
  625 + type: 'arc',
  626 + fillStyle: '#fff',
  627 + strokeStyle: '#c33',
  628 + strokeWidth: 2,
  629 + radius: 3
  630 + }
  631 + }).drawLayers();
  632 + }
  633 + else {
  634 + //jcanvas property
  635 + layer.draggable = false;
  636 + }
607 637 }
608 638  
609 639 }).drawLayers();
... ... @@ -639,7 +669,10 @@ AIA.controller(&quot;HomeController&quot;, [&quot;$rootScope&quot;, &quot;Modules&quot;, &quot;$log&quot;, &quot;$location&quot;,
639 669  
640 670 },
641 671  
642   - click: function (layer) {
  672 + click: function (layer) {
  673 + if ($rootScope.isAnnotaionToolBarDrawingModeActive == true) {
  674 + //jcanvas property
  675 + layer.draggable = true;
643 676 $rootScope.canvasLayerNameCollection = [];
644 677 $rootScope.canvasLayerNameCollection.push(layer.name);
645 678 $(canvasId).setLayer(layer.name, {
... ... @@ -652,9 +685,16 @@ AIA.controller(&quot;HomeController&quot;, [&quot;$rootScope&quot;, &quot;Modules&quot;, &quot;$log&quot;, &quot;$location&quot;,
652 685 cornerRadius: 3
653 686 }
654 687 }).drawLayers();
655   -
  688 + }
  689 + else {
  690 + //jcanvas property
  691 + layer.draggable = false;
  692 + }
656 693 },
657   - mouseout: function (layer) {
  694 + mouseout: function (layer) {
  695 + if ($rootScope.isAnnotaionToolBarDrawingModeActive == true) {
  696 + //jcanvas property
  697 + layer.draggable = true;
658 698 $rootScope.canvasLayerNameCollection = [];
659 699 $(canvasId).setLayer(layer.name, {
660 700 handle: {
... ... @@ -667,22 +707,32 @@ AIA.controller(&quot;HomeController&quot;, [&quot;$rootScope&quot;, &quot;Modules&quot;, &quot;$log&quot;, &quot;$location&quot;,
667 707 }
668 708  
669 709 }).drawLayers();
670   -
  710 + }
  711 + else {
  712 + //jcanvas property
  713 + layer.draggable = false;
  714 + }
671 715 },
672 716 mouseover: function (layer) {
673   -
674   -
675   - $(canvasId).setLayer(layer.name, {
676   - handle: {
677   - type: 'rectangle',
678   - fillStyle: '#fff',
679   - strokeStyle: '#c33',
680   - strokeWidth: 2,
681   - width: 5, height: 5,
682   - cornerRadius: 3
683   - }
684   - }).drawLayers();
685   -
  717 + if ($rootScope.isAnnotaionToolBarDrawingModeActive == true) {
  718 + //jcanvas property
  719 + layer.draggable = true;
  720 +
  721 + $(canvasId).setLayer(layer.name, {
  722 + handle: {
  723 + type: 'rectangle',
  724 + fillStyle: '#fff',
  725 + strokeStyle: '#c33',
  726 + strokeWidth: 2,
  727 + width: 5, height: 5,
  728 + cornerRadius: 3
  729 + }
  730 + }).drawLayers();
  731 + }
  732 + else {
  733 + //jcanvas property
  734 + layer.draggable = false;
  735 + }
686 736 }
687 737 }).drawLayers();
688 738 }
... ... @@ -712,49 +762,68 @@ AIA.controller(&quot;HomeController&quot;, [&quot;$rootScope&quot;, &quot;Modules&quot;, &quot;$log&quot;, &quot;$location&quot;,
712 762 resizeFromCenter: false,
713 763 handlePlacement: 'both',
714 764 click: function (layer) {
715   - $rootScope.canvasLayerNameCollection = [];
716   - $rootScope.canvasLayerNameCollection.push(layer.name);
717   - $(canvasId).setLayer(layer.name, {
718   - handle: {
719   - type: 'arc',
720   - fillStyle: '#fff',
721   - strokeStyle: '#c33',
722   - strokeWidth: 2,
723   - radius: 3
724   - }
725   - }).drawLayers();
726   -
  765 + if ($rootScope.isAnnotaionToolBarDrawingModeActive == true) {
  766 + //jcanvas property
  767 + layer.draggable = true;
  768 + $rootScope.canvasLayerNameCollection = [];
  769 + $rootScope.canvasLayerNameCollection.push(layer.name);
  770 + $(canvasId).setLayer(layer.name, {
  771 + handle: {
  772 + type: 'arc',
  773 + fillStyle: '#fff',
  774 + strokeStyle: '#c33',
  775 + strokeWidth: 2,
  776 + radius: 3
  777 + }
  778 + }).drawLayers();
  779 + }
  780 + else {
  781 + //jcanvas property
  782 + layer.draggable = false;
  783 + }
727 784 },
728 785 mouseout: function (layer) {
729   - $rootScope.canvasLayerNameCollection = [];
730   -
731   - $(canvasId).setLayer(layer.name, {
732   - handle: {
733   - type: 'arc',
734   - fillStyle: '#fff',
735   - strokeStyle: '#c33',
736   - strokeWidth: 0,
737   - // width: 0, height: 0,
738   - radius: 0
739   - }
740   -
741   - }).drawLayers();
742   -
  786 + if ($rootScope.isAnnotaionToolBarDrawingModeActive == true) {
  787 + //jcanvas property
  788 + layer.draggable = true;
  789 + $rootScope.canvasLayerNameCollection = [];
  790 +
  791 + $(canvasId).setLayer(layer.name, {
  792 + handle: {
  793 + type: 'arc',
  794 + fillStyle: '#fff',
  795 + strokeStyle: '#c33',
  796 + strokeWidth: 0,
  797 + // width: 0, height: 0,
  798 + radius: 0
  799 + }
  800 +
  801 + }).drawLayers();
  802 + }
  803 + else {
  804 + layer.draggable = false;
  805 + }
743 806 },
744 807 mouseover: function (layer) {
745   -
746   -
747   - $(canvasId).setLayer(layer.name, {
748   - handle: {
749   - type: 'arc',
750   - fillStyle: '#fff',
751   - strokeStyle: '#c33',
752   - strokeWidth: 2,
753   - // width: 5, height: 5,
754   - radius: 3
755   - }
756   - }).drawLayers();
757   -
  808 + if ($rootScope.isAnnotaionToolBarDrawingModeActive == true) {
  809 + //jcanvas property
  810 + layer.draggable = true;
  811 +
  812 + $(canvasId).setLayer(layer.name, {
  813 + handle: {
  814 + type: 'arc',
  815 + fillStyle: '#fff',
  816 + strokeStyle: '#c33',
  817 + strokeWidth: 2,
  818 + // width: 5, height: 5,
  819 + radius: 3
  820 + }
  821 + }).drawLayers();
  822 + }
  823 + else {
  824 + //jcanvas property
  825 + layer.draggable = false;
  826 + }
758 827 }
759 828 }).drawLayers();
760 829 }
... ... @@ -780,50 +849,71 @@ AIA.controller(&quot;HomeController&quot;, [&quot;$rootScope&quot;, &quot;Modules&quot;, &quot;$log&quot;, &quot;$location&quot;,
780 849 x2: x, y2: y,
781 850  
782 851 click: function (layer) {
783   - $rootScope.canvasLayerNameCollection = [];
784   - $rootScope.canvasLayerNameCollection.push(layer.name);
785   - $(canvasId).setLayer(layer.name, {
786   - handle: {
787   - type: 'arc',
788   - fillStyle: '#fff',
789   - strokeStyle: '#c33',
790   - strokeWidth: 2,
791   - // width: 5, height: 5,
792   - radius: 3
793   - }
794   - }).drawLayers();
795   - // $("#canvas").removeLayer(layer.name).drawLayers();
  852 + if ($rootScope.isAnnotaionToolBarDrawingModeActive == true) {
  853 + //jcanvas property
  854 + layer.draggable = true;
  855 + $rootScope.canvasLayerNameCollection = [];
  856 + $rootScope.canvasLayerNameCollection.push(layer.name);
  857 + $(canvasId).setLayer(layer.name, {
  858 + handle: {
  859 + type: 'arc',
  860 + fillStyle: '#fff',
  861 + strokeStyle: '#c33',
  862 + strokeWidth: 2,
  863 + // width: 5, height: 5,
  864 + radius: 3
  865 + }
  866 + }).drawLayers();
  867 + // $("#canvas").removeLayer(layer.name).drawLayers();
  868 + }
  869 + else {
  870 + //jcanvas property
  871 + layer.draggable = false;
  872 + }
796 873  
797 874 },
798 875 mouseout: function (layer) {
799   - $rootScope.canvasLayerNameCollection = [];
800   - $(canvasId).setLayer(layer.name, {
801   - handle: {
802   - type: 'arc',
803   - fillStyle: '#fff',
804   - strokeStyle: '#c33',
805   - strokeWidth: 0,
806   - // width: 0, height: 0,
807   - radius: 0
808   - }
809   -
810   - }).drawLayers();
811   -
  876 + if ($rootScope.isAnnotaionToolBarDrawingModeActive == true) {
  877 + //jcanvas property
  878 + layer.draggable = true;
  879 + $rootScope.canvasLayerNameCollection = [];
  880 + $(canvasId).setLayer(layer.name, {
  881 + handle: {
  882 + type: 'arc',
  883 + fillStyle: '#fff',
  884 + strokeStyle: '#c33',
  885 + strokeWidth: 0,
  886 + // width: 0, height: 0,
  887 + radius: 0
  888 + }
  889 +
  890 + }).drawLayers();
  891 + }
  892 + else {
  893 + //jcanvas property
  894 + layer.draggable = false;
  895 + }
812 896 },
813 897 mouseover: function (layer) {
814 898  
815   -
816   - $(canvasId).setLayer(layer.name, {
817   - handle: {
818   - type: 'arc',
819   - fillStyle: '#fff',
820   - strokeStyle: '#c33',
821   - strokeWidth: 2,
822   - // width: 5, height: 5,
823   - radius: 3
824   - }
825   - }).drawLayers();
826   -
  899 + if ($rootScope.isAnnotaionToolBarDrawingModeActive == true) {
  900 + //jcanvas property
  901 + layer.draggable = true;
  902 + $(canvasId).setLayer(layer.name, {
  903 + handle: {
  904 + type: 'arc',
  905 + fillStyle: '#fff',
  906 + strokeStyle: '#c33',
  907 + strokeWidth: 2,
  908 + // width: 5, height: 5,
  909 + radius: 3
  910 + }
  911 + }).drawLayers();
  912 + }
  913 + else {
  914 + //jcanvas property
  915 + layer.draggable = false;
  916 + }
827 917 }
828 918  
829 919 });
... ... @@ -857,59 +947,77 @@ AIA.controller(&quot;HomeController&quot;, [&quot;$rootScope&quot;, &quot;Modules&quot;, &quot;$log&quot;, &quot;$location&quot;,
857 947 x2: x, y2: y,
858 948  
859 949 click: function (layer) {
860   -
861   - $rootScope.shapeTypePin = "Pin";
862   - $rootScope.canvasLayerNameCollection = [];
863   - var pinLine_layer = layer.name;
864   - var pinLine_layer_split = pinLine_layer.split("_");
865   - var pinArcName = "ArcPin_";
866   - var pinResult = pinArcName.concat(pinLine_layer_split[1]);
867   -
868   - $rootScope.canvasLayerNameCollection.push({ pinName: layer.name, ArcName: pinResult });
869   -
870   - $(canvasId).setLayer(layer.name, {
871   - handle: {
872   - type: 'arc',
873   - fillStyle: '#fff',
874   - strokeStyle: '#c33',
875   - strokeWidth: 2,
876   - // width: 5, height: 5,
877   - radius: 3
878   - }
879   - }).drawLayers();
880   -
881   -
  950 + if ($rootScope.isAnnotaionToolBarDrawingModeActive == true) {
  951 + //jcanvas property
  952 + layer.draggable = true;
  953 + $rootScope.shapeTypePin = "Pin";
  954 + $rootScope.canvasLayerNameCollection = [];
  955 + var pinLine_layer = layer.name;
  956 + var pinLine_layer_split = pinLine_layer.split("_");
  957 + var pinArcName = "ArcPin_";
  958 + var pinResult = pinArcName.concat(pinLine_layer_split[1]);
  959 +
  960 + $rootScope.canvasLayerNameCollection.push({ pinName: layer.name, ArcName: pinResult });
  961 +
  962 + $(canvasId).setLayer(layer.name, {
  963 + handle: {
  964 + type: 'arc',
  965 + fillStyle: '#fff',
  966 + strokeStyle: '#c33',
  967 + strokeWidth: 2,
  968 + // width: 5, height: 5,
  969 + radius: 3
  970 + }
  971 + }).drawLayers();
  972 +
  973 + }
  974 + else {
  975 + //jcanvas property
  976 + layer.draggable = false;
  977 + }
882 978 },
883 979 mouseout: function (layer) {
884   -
885   - $rootScope.canvasLayerNameCollection = [];
886   - $(canvasId).setLayer(layer.name, {
887   - handle: {
888   - type: 'arc',
889   - fillStyle: '#fff',
890   - strokeStyle: '#c33',
891   - strokeWidth: 0,
892   - // width: 0, height: 0,
893   - radius: 0
894   - }
895   -
896   - }).drawLayers();
897   -
  980 + if ($rootScope.isAnnotaionToolBarDrawingModeActive == true) {
  981 + //jcanvas property
  982 + layer.draggable = true;
  983 + $rootScope.canvasLayerNameCollection = [];
  984 + $(canvasId).setLayer(layer.name, {
  985 + handle: {
  986 + type: 'arc',
  987 + fillStyle: '#fff',
  988 + strokeStyle: '#c33',
  989 + strokeWidth: 0,
  990 + // width: 0, height: 0,
  991 + radius: 0
  992 + }
  993 +
  994 + }).drawLayers();
  995 + }
  996 + else {
  997 + //jcanvas property
  998 + layer.draggable = false;
  999 + }
898 1000 },
899 1001 mouseover: function (layer) {
900 1002  
901   -
902   - $(canvasId).setLayer(layer.name, {
903   - handle: {
904   - type: 'arc',
905   - fillStyle: '#fff',
906   - strokeStyle: '#c33',
907   - strokeWidth: 2,
908   - // width: 5, height: 5,
909   - radius: 3
910   - }
911   - }).drawLayers();
912   -
  1003 + if ($rootScope.isAnnotaionToolBarDrawingModeActive == true) {
  1004 + //jcanvas property
  1005 + layer.draggable = true;
  1006 + $(canvasId).setLayer(layer.name, {
  1007 + handle: {
  1008 + type: 'arc',
  1009 + fillStyle: '#fff',
  1010 + strokeStyle: '#c33',
  1011 + strokeWidth: 2,
  1012 + // width: 5, height: 5,
  1013 + radius: 3
  1014 + }
  1015 + }).drawLayers();
  1016 + }
  1017 + else {
  1018 + //jcanvas property
  1019 + layer.draggable = false;
  1020 + }
913 1021 }
914 1022 }).drawArc({
915 1023 draggable: true,
... ... @@ -990,85 +1098,111 @@ AIA.controller(&quot;HomeController&quot;, [&quot;$rootScope&quot;, &quot;Modules&quot;, &quot;$log&quot;, &quot;$location&quot;,
990 1098  
991 1099 },
992 1100 click: function (layer) {
993   -
994   - $rootScope.canvasLayerNameCollection = [];
995   - $rootScope.canvasLayerNameCollection.push(layer.name);
996   - $('#canvas').setLayer(layer.name, {
997   - handle: {
998   - type: 'rectangle',
999   - fillStyle: '#fff',
1000   - strokeStyle: '#c33',
1001   - strokeWidth: 2,
1002   - width: 5, height: 5,
1003   - cornerRadius: 3
1004   - }
1005   - }).drawLayers();
1006   -
  1101 + if ($rootScope.isAnnotaionToolBarDrawingModeActive == true) {
  1102 + //jcanvas property
  1103 + layer.draggable = true;
  1104 + $rootScope.canvasLayerNameCollection = [];
  1105 + $rootScope.canvasLayerNameCollection.push(layer.name);
  1106 + $('#canvas').setLayer(layer.name, {
  1107 + handle: {
  1108 + type: 'rectangle',
  1109 + fillStyle: '#fff',
  1110 + strokeStyle: '#c33',
  1111 + strokeWidth: 2,
  1112 + width: 5, height: 5,
  1113 + cornerRadius: 3
  1114 + }
  1115 + }).drawLayers();
  1116 + }
  1117 + else {
  1118 + //jcanvas property
  1119 + layer.draggable = false;
  1120 + }
1007 1121 },
1008 1122 dblclick: function (layer) {
  1123 + if ($rootScope.isAnnotaionToolBarDrawingModeActive == true) {
  1124 + //jcanvas property
  1125 + layer.draggable = true;
  1126 + $rootScope.IsTextAlreadySave = false;
  1127 + var RectNameArray = (layer.name).split("_");
1009 1128  
1010   - $rootScope.IsTextAlreadySave = false;
1011   - var RectNameArray = (layer.name).split("_");
1012   -
1013   - var TextAreaRectangleName = "TextArea_";
1014   - var TextAreaRectNameConcat = TextAreaRectangleName.concat(RectNameArray[1]);
1015   - $rootScope.TextAreaRectID = layer.name;
1016   - $rootScope.TextID = TextAreaRectNameConcat;
1017   -
1018   - $rootScope.rectDimension.push({ width: layer.width, height: layer.height, x: layer.x, y: layer.y });
1019   - $("#annotationTextModal").css("padding-right", "0px");
1020   - document.getElementById('modelbackground').style.display = "block";
1021   - $("#annotationTextModal").modal("toggle");
  1129 + var TextAreaRectangleName = "TextArea_";
  1130 + var TextAreaRectNameConcat = TextAreaRectangleName.concat(RectNameArray[1]);
  1131 + $rootScope.TextAreaRectID = layer.name;
  1132 + $rootScope.TextID = TextAreaRectNameConcat;
1022 1133  
1023   - $("#text_area").val('');
1024   - $("#text_area").css({ "font-family": "Arial", "font-size": "14px", "font-weight": "normal", "font-style": "normal", "color": "#000", "text-align": "left", "text-decoration": "none" });
1025   - $("#font-color .minicolors .minicolors-swatch .minicolors-swatch-color").css({ "background-color": "#000000" });
1026   - // $("#font-color .minicolors .minicolors-swatch .minicolors-swatch-color").addClass("ActiveDefaultColorAnnotation");
  1134 + $rootScope.rectDimension.push({ width: layer.width, height: layer.height, x: layer.x, y: layer.y });
  1135 + $("#annotationTextModal").css("padding-right", "0px");
  1136 + document.getElementById('modelbackground').style.display = "block";
  1137 + $("#annotationTextModal").modal("toggle");
1027 1138  
1028   - $("#selected-font-family option:eq(0)").prop('selected', true);
1029   - $("#selected-font-size option:eq(0)").prop('selected', true);
  1139 + $("#text_area").val('');
  1140 + $("#text_area").css({ "font-family": "Arial", "font-size": "14px", "font-weight": "normal", "font-style": "normal", "color": "#000", "text-align": "left", "text-decoration": "none" });
  1141 + $("#font-color .minicolors .minicolors-swatch .minicolors-swatch-color").css({ "background-color": "#000000" });
  1142 + // $("#font-color .minicolors .minicolors-swatch .minicolors-swatch-color").addClass("ActiveDefaultColorAnnotation");
1030 1143  
1031   - $("#text-italic").removeClass("ActiveFormattingButtonClass");
  1144 + $("#selected-font-family option:eq(0)").prop('selected', true);
  1145 + $("#selected-font-size option:eq(0)").prop('selected', true);
1032 1146  
1033   - $("#text-bold").removeClass("ActiveFormattingButtonClass");
  1147 + $("#text-italic").removeClass("ActiveFormattingButtonClass");
1034 1148  
1035   - $("#text-underline").removeClass("ActiveFormattingButtonClass");
  1149 + $("#text-bold").removeClass("ActiveFormattingButtonClass");
1036 1150  
1037   - $("#text-left").removeClass("ActiveFormattingButtonClass");
  1151 + $("#text-underline").removeClass("ActiveFormattingButtonClass");
1038 1152  
1039   - $("#text-right").removeClass("ActiveFormattingButtonClass");
  1153 + $("#text-left").removeClass("ActiveFormattingButtonClass");
1040 1154  
1041   - $("#text-center").removeClass("ActiveFormattingButtonClass");
  1155 + $("#text-right").removeClass("ActiveFormattingButtonClass");
1042 1156  
  1157 + $("#text-center").removeClass("ActiveFormattingButtonClass");
  1158 + }
  1159 + else {
  1160 + //jcanvas property
  1161 + layer.draggable = false;
  1162 + }
1043 1163 },
1044 1164 mouseout: function (layer) {
1045   - $rootScope.canvasLayerNameCollection = [];
1046   - $('#canvas').setLayer(layer.name, {
1047   - handle: {
1048   - type: 'rectangle',
1049   - fillStyle: 'pink',
1050   - strokeStyle: 'yellow',
1051   - strokeWidth: 0,
1052   - width: 0, height: 0,
1053   - cornerRadius: 0
1054   - }
1055   -
1056   - }).drawLayers();
1057   -
  1165 + if ($rootScope.isAnnotaionToolBarDrawingModeActive == true) {
  1166 + //jcanvas property
  1167 + layer.draggable = true;
  1168 + $rootScope.canvasLayerNameCollection = [];
  1169 + $('#canvas').setLayer(layer.name, {
  1170 + handle: {
  1171 + type: 'rectangle',
  1172 + fillStyle: 'pink',
  1173 + strokeStyle: 'yellow',
  1174 + strokeWidth: 0,
  1175 + width: 0, height: 0,
  1176 + cornerRadius: 0
  1177 + }
  1178 +
  1179 + }).drawLayers();
  1180 + }
  1181 + else {
  1182 + //jcanvas property
  1183 + layer.draggable = false;
  1184 + }
1058 1185 },
1059 1186 mouseover: function (layer) {
  1187 + if ($rootScope.isAnnotaionToolBarDrawingModeActive == true) {
  1188 + //jcanvas property
  1189 + layer.draggable = true;
  1190 + $('#canvas').setLayer(layer.name, {
  1191 + handle: {
  1192 + type: 'rectangle',
  1193 + fillStyle: '#fff',
  1194 + strokeStyle: '#c33',
  1195 + strokeWidth: 2,
  1196 + width: 5, height: 5,
  1197 + cornerRadius: 3
  1198 + }
  1199 + }).drawLayers();
1060 1200  
1061   - $('#canvas').setLayer(layer.name, {
1062   - handle: {
1063   - type: 'rectangle',
1064   - fillStyle: '#fff',
1065   - strokeStyle: '#c33',
1066   - strokeWidth: 2,
1067   - width: 5, height: 5,
1068   - cornerRadius: 3
1069   - }
1070   - }).drawLayers();
1071   -
  1201 + }
  1202 + else {
  1203 + //jcanvas property
  1204 + layer.draggable = false;
  1205 + }
1072 1206 }
1073 1207 });
1074 1208  
... ... @@ -1190,27 +1324,32 @@ AIA.controller(&quot;HomeController&quot;, [&quot;$rootScope&quot;, &quot;Modules&quot;, &quot;$log&quot;, &quot;$location&quot;,
1190 1324 PaintCanvasctx.beginPath();
1191 1325 break;
1192 1326 case "Line":
  1327 + $rootScope.isAnnotaionToolBarDrawingModeActive = true;
1193 1328 $rootScope.LineNumber = $rootScope.ObjectIndex++;
1194 1329 // $rootScope.isLinePreviewCompleted = true;
1195 1330 $rootScope.DrawLineOnModuleItem('#canvas', $rootScope.LineNumber, $rootScope.shapestyleborderColor, $rootScope.shapestyleborderWidth, $rootScope.offsetX1, $rootScope.offsetY1, $rootScope.x, $rootScope.y)
1196 1331 break;
1197 1332 case "Rectangle":
  1333 + $rootScope.isAnnotaionToolBarDrawingModeActive = true;
1198 1334 $rootScope.rectNumber = $rootScope.ObjectIndex++;
1199 1335 // $rootScope.isRectanglePreviewCompleted = true;
1200 1336 $rootScope.DrawRectangleOnModuleItem('#canvas', $rootScope.rectNumber, $rootScope.shapestyleFillColor, $rootScope.shapestyleborderColor, $rootScope.shapestyleOpacity, $rootScope.shapestyleborderWidth, $rootScope.offsetX1, $rootScope.offsetY1, $rootScope.x, $rootScope.y);
1201 1337  
1202 1338 break;
1203 1339 case "Circle":
  1340 + $rootScope.isAnnotaionToolBarDrawingModeActive = true;
1204 1341 $rootScope.CircleNumber = $rootScope.ObjectIndex++;
1205 1342 // $rootScope.isCirclePreviewCompleted = true;
1206 1343 $rootScope.DrawCircleOnModuleItem('#canvas', $rootScope.CircleNumber, $rootScope.shapestyleOpacity, $rootScope.shapestyleborderColor, $rootScope.shapestyleborderWidth, $rootScope.shapestyleFillColor, $rootScope.offsetX1, $rootScope.offsetY1, $rootScope.x, $rootScope.y);
1207 1344 break;
1208 1345 case "Arrow":
  1346 + $rootScope.isAnnotaionToolBarDrawingModeActive = true;
1209 1347 $rootScope.ArrowNumber = $rootScope.ObjectIndex++;
1210 1348 //$rootScope.isArrowPreviewCompleted = true;
1211 1349 $rootScope.DrawArrowOnModuleItem('#canvas', $rootScope.ArrowNumber, $rootScope.shapestyleborderColor, $rootScope.shapestyleborderWidth, $rootScope.offsetX1, $rootScope.offsetY1, $rootScope.x, $rootScope.y);
1212 1350 break;
1213 1351 case "Pin":
  1352 + $rootScope.isAnnotaionToolBarDrawingModeActive = true;
1214 1353 $rootScope.PinNumber = $rootScope.PinObjectIndex++;
1215 1354 $rootScope.PinArcNumber = $rootScope.ArcObjectIndex++;
1216 1355  
... ... @@ -1219,6 +1358,7 @@ AIA.controller(&quot;HomeController&quot;, [&quot;$rootScope&quot;, &quot;Modules&quot;, &quot;$log&quot;, &quot;$location&quot;,
1219 1358 $rootScope.DrawPinOnModuleItem('#canvas', $rootScope.PinNumber, $rootScope.offsetX1, $rootScope.offsetY1, $rootScope.x, $rootScope.y, $rootScope.PinArcNumber);
1220 1359 break;
1221 1360 case "TextArea":
  1361 + $rootScope.isAnnotaionToolBarDrawingModeActive = true;
1222 1362 $rootScope.IsTextAlreadySave = false;
1223 1363 $("#text_area").val('');
1224 1364 // Draw text
... ... @@ -1365,186 +1505,215 @@ AIA.controller(&quot;HomeController&quot;, [&quot;$rootScope&quot;, &quot;Modules&quot;, &quot;$log&quot;, &quot;$location&quot;,
1365 1505 height: $rootScope.rectDimension[$rootScope.rectDimension.length - 1].height,
1366 1506 resizeFromCenter: false,
1367 1507 click: function (layer) {
1368   - $rootScope.shapeTypeText = "textAreaRect";
1369   -
1370   - var layerNameSplit = layer.name;
1371   - var splitedName = layerNameSplit.split("_");
1372   - var textValName = "TextAreaNew_";
1373   - var concatinateResult = textValName.concat(splitedName[1]);
1374   - $rootScope.canvasLayerNameCollection = [];
1375   - $rootScope.canvasLayerNameCollection.push({ textareaRectangle: layer.name, textareaString: concatinateResult });
1376   - $('#canvas').setLayer(layer.name, {
1377   - handle: {
1378   - type: 'rectangle',
1379   - fillStyle: '#fff',
1380   - strokeStyle: '#c33',
1381   - strokeWidth: 2,
1382   - width: 5, height: 5,
1383   - cornerRadius: 3
  1508 + if ($rootScope.isAnnotaionToolBarDrawingModeActive == true) {
  1509 + //jcanvas property
  1510 + layer.draggable = true;
  1511 + $rootScope.shapeTypeText = "textAreaRect";
  1512 +
  1513 + var layerName = layer.name;
  1514 + var splitedName = layerName.split("_");
  1515 + var textValName = "TextAreaNew_";
  1516 + var concatinateResult = textValName.concat(splitedName[1]);
  1517 + $rootScope.canvasLayerNameCollection = [];
  1518 + $rootScope.canvasLayerNameCollection.push({ textareaRectangle: layer.name, textareaString: concatinateResult });
  1519 + $('#canvas').setLayer(layer.name, {
  1520 + handle: {
  1521 + type: 'rectangle',
  1522 + fillStyle: '#fff',
  1523 + strokeStyle: '#c33',
  1524 + strokeWidth: 2,
  1525 + width: 5, height: 5,
  1526 + cornerRadius: 3
  1527 + }
  1528 + }).drawLayers();
  1529 + }
  1530 + else {
  1531 + //jcanvas property
  1532 + layer.draggable = false;
1384 1533 }
1385   - }).drawLayers();
1386 1534 },
1387 1535 dblclick: function (layer) {
  1536 + if ($rootScope.isAnnotaionToolBarDrawingModeActive == true) {
  1537 + //jcanvas property
  1538 + layer.draggable = true;
  1539 + $rootScope.isTextAreaClosedButtonActive = false;
  1540 + $rootScope.IsTextAlreadySave = true;
1388 1541  
1389   - $rootScope.isTextAreaClosedButtonActive = false;
1390   - $rootScope.IsTextAlreadySave = true;
  1542 + var _rectLayerOnSave = layer.name;
  1543 + var _rectLayerOnSaveSplit = _rectLayerOnSave.split("_");
  1544 + var TextAreaRectName = "TextAreaNew_";
  1545 + var TextAreaRectNameConcatenated = TextAreaRectName.concat(_rectLayerOnSaveSplit[1]);
1391 1546  
1392   - var _rectLayerOnSave = layer.name;
1393   - var _rectLayerOnSaveSplit = _rectLayerOnSave.split("_");
1394   - var TextAreaRectName = "TextAreaNew_";
1395   - var TextAreaRectNameConcatenated = TextAreaRectName.concat(_rectLayerOnSaveSplit[1]);
  1547 + $rootScope.layerNameArr = layer.name;
  1548 + $rootScope.rectTextArr = TextAreaRectNameConcatenated;
1396 1549  
1397   - $rootScope.layerNameArr = layer.name;
1398   - $rootScope.rectTextArr = TextAreaRectNameConcatenated;
1399 1550  
  1551 + $rootScope.rectDimension.push({ width: layer.width, height: layer.height, x: layer.x, y: layer.y });
1400 1552  
1401   - $rootScope.rectDimension.push({ width: layer.width, height: layer.height, x: layer.x, y: layer.y });
  1553 + for (var i = 0; i <= $rootScope.TextPropertyArray.length - 1; i++) {
  1554 + if ($rootScope.TextPropertyArray[i].layerName == TextAreaRectNameConcatenated) {
1402 1555  
1403   - for (var i = 0; i <= $rootScope.TextPropertyArray.length - 1; i++) {
1404   - if ($rootScope.TextPropertyArray[i].layerName == TextAreaRectNameConcatenated) {
  1556 + var textArrVal = $rootScope.TextPropertyArray[i].Rect_Text;
  1557 + $("#text_area").val(textArrVal);
  1558 + var fontStyleProp = $rootScope.TextPropertyArray[i].FontStyle;
  1559 + var fontWeightProp = fontStyleProp.split(" ");
1405 1560  
1406   - var textArrVal = $rootScope.TextPropertyArray[i].Rect_Text;
1407   - $("#text_area").val(textArrVal);
1408   - var fontStyleProp = $rootScope.TextPropertyArray[i].FontStyle;
1409   - var fontWeightProp = fontStyleProp.split(" ");
  1561 + $("#text_area").css("font-size", $rootScope.TextPropertyArray[i].FontSize);
  1562 + $("#text_area").css("font-weight", fontWeightProp[0]);
  1563 + $("#text_area").css("font-style", fontWeightProp[1]);
  1564 + $("#text_area").css("text-align", $rootScope.TextPropertyArray[i].Align);
  1565 + $("#text_area").css("color", $rootScope.TextPropertyArray[i].FontColor);
  1566 + $("#text_area").css("font-family", $rootScope.TextPropertyArray[i].FontFamily);
  1567 + $("#text_area").css("text-decoration", $rootScope.TextPropertyArray[i].TextDecoration);
  1568 + $("#font-color .minicolors .minicolors-swatch .minicolors-swatch-color").css({ "background-color": $rootScope.TextPropertyArray[i].FontColor });
1410 1569  
1411   - $("#text_area").css("font-size", $rootScope.TextPropertyArray[i].FontSize);
1412   - $("#text_area").css("font-weight", fontWeightProp[0]);
1413   - $("#text_area").css("font-style", fontWeightProp[1]);
1414   - $("#text_area").css("text-align", $rootScope.TextPropertyArray[i].Align);
1415   - $("#text_area").css("color", $rootScope.TextPropertyArray[i].FontColor);
1416   - $("#text_area").css("font-family", $rootScope.TextPropertyArray[i].FontFamily);
1417   - $("#text_area").css("text-decoration", $rootScope.TextPropertyArray[i].TextDecoration);
1418   - $("#font-color .minicolors .minicolors-swatch .minicolors-swatch-color").css({ "background-color": $rootScope.TextPropertyArray[i].FontColor });
  1570 + var CurrentFontFamily = $rootScope.TextPropertyArray[i].FontFamily;
  1571 + // alert(CurrentFontFamily);
  1572 + // CurrentFontFamily = CurrentFontFamily.replace(/'/g, "");
  1573 + var CurrentFontSize = parseInt($rootScope.TextPropertyArray[i].FontSize);
  1574 + $("#selected-font-family option[value=" + CurrentFontFamily + "]").prop('selected', true);
  1575 + $("#selected-font-size option[value=" + CurrentFontSize + "]").prop('selected', true);
1419 1576  
1420   - var CurrentFontFamily = $rootScope.TextPropertyArray[i].FontFamily;
1421   - // alert(CurrentFontFamily);
1422   - // CurrentFontFamily = CurrentFontFamily.replace(/'/g, "");
1423   - var CurrentFontSize = parseInt($rootScope.TextPropertyArray[i].FontSize);
1424   - $("#selected-font-family option[value=" + CurrentFontFamily + "]").prop('selected', true);
1425   - $("#selected-font-size option[value=" + CurrentFontSize + "]").prop('selected', true);
  1577 + CurrentFontFamily = '';
  1578 + CurrentFontSize = '';
1426 1579  
1427   - CurrentFontFamily = '';
1428   - CurrentFontSize = '';
1429 1580  
  1581 + if ($rootScope.TextPropertyArray[i].TextDecoration == "underline") {
1430 1582  
1431   - if ($rootScope.TextPropertyArray[i].TextDecoration == "underline") {
  1583 + $("#text-underline").addClass("ActiveFormattingButtonClass");
1432 1584  
1433   - $("#text-underline").addClass("ActiveFormattingButtonClass");
  1585 + }
1434 1586  
1435   - }
  1587 + else {
1436 1588  
1437   - else {
  1589 + $("#text-underline").removeClass("ActiveFormattingButtonClass");
1438 1590  
1439   - $("#text-underline").removeClass("ActiveFormattingButtonClass");
  1591 + }
1440 1592  
1441   - }
  1593 + //adding text font weight active class in text edit pop-up
1442 1594  
1443   - //adding text font weight active class in text edit pop-up
  1595 + if (fontWeightProp[0] == 700) {
1444 1596  
1445   - if (fontWeightProp[0] == 700) {
  1597 + $("#text-bold").addClass("ActiveFormattingButtonClass");
1446 1598  
1447   - $("#text-bold").addClass("ActiveFormattingButtonClass");
  1599 + }
1448 1600  
1449   - }
  1601 + else {
1450 1602  
1451   - else {
  1603 + $("#text-bold").removeClass("ActiveFormattingButtonClass");
1452 1604  
1453   - $("#text-bold").removeClass("ActiveFormattingButtonClass");
  1605 + }
1454 1606  
1455   - }
  1607 + //adding text font style active class in text edit pop-up
1456 1608  
1457   - //adding text font style active class in text edit pop-up
  1609 + if (fontWeightProp[1] == "italic") {
1458 1610  
1459   - if (fontWeightProp[1] == "italic") {
1460 1611  
  1612 + $("#text-italic").addClass("ActiveFormattingButtonClass");
  1613 + }
  1614 + else {
  1615 + $("#text-italic").removeClass("ActiveFormattingButtonClass");
1461 1616  
1462   - $("#text-italic").addClass("ActiveFormattingButtonClass");
1463   - }
1464   - else {
1465   - $("#text-italic").removeClass("ActiveFormattingButtonClass");
1466 1617  
  1618 + }
1467 1619  
1468   - }
  1620 + //adding text alignment active class in text edit pop-up
1469 1621  
1470   - //adding text alignment active class in text edit pop-up
  1622 + if ($rootScope.TextPropertyArray[i].Align == "left") {
1471 1623  
1472   - if ($rootScope.TextPropertyArray[i].Align == "left") {
  1624 + $("#text-right").removeClass("ActiveFormattingButtonClass");
1473 1625  
1474   - $("#text-right").removeClass("ActiveFormattingButtonClass");
  1626 + $("#text-center").removeClass("ActiveFormattingButtonClass")
1475 1627  
1476   - $("#text-center").removeClass("ActiveFormattingButtonClass")
  1628 + $("#text-left").addClass("ActiveFormattingButtonClass");
1477 1629  
1478   - $("#text-left").addClass("ActiveFormattingButtonClass");
  1630 + }
1479 1631  
1480   - }
  1632 + else if ($rootScope.TextPropertyArray[i].Align == "right") {
1481 1633  
1482   - else if ($rootScope.TextPropertyArray[i].Align == "right") {
1483 1634  
1484 1635  
  1636 + $("#text-center").removeClass("ActiveFormattingButtonClass")
1485 1637  
1486   - $("#text-center").removeClass("ActiveFormattingButtonClass")
  1638 + $("#text-left").removeClass("ActiveFormattingButtonClass");
1487 1639  
1488   - $("#text-left").removeClass("ActiveFormattingButtonClass");
  1640 + $("#text-right").addClass("ActiveFormattingButtonClass");
  1641 + }
1489 1642  
1490   - $("#text-right").addClass("ActiveFormattingButtonClass");
1491   - }
  1643 + else if ($rootScope.TextPropertyArray[i].Align == "center") {
1492 1644  
1493   - else if ($rootScope.TextPropertyArray[i].Align == "center") {
  1645 + $("#text-left").removeClass("ActiveFormattingButtonClass");
1494 1646  
1495   - $("#text-left").removeClass("ActiveFormattingButtonClass");
  1647 + $("#text-right").removeClass("ActiveFormattingButtonClass");
1496 1648  
1497   - $("#text-right").removeClass("ActiveFormattingButtonClass");
  1649 + $("#text-center").addClass("ActiveFormattingButtonClass");
1498 1650  
1499   - $("#text-center").addClass("ActiveFormattingButtonClass");
  1651 + }
1500 1652  
1501 1653 }
  1654 + else {
  1655 + // alert("no");
1502 1656  
1503   - }
1504   - else {
1505   - // alert("no");
  1657 + }
1506 1658  
1507 1659 }
1508 1660  
1509   - }
1510   -
1511   -
1512   - // _rectLayerOnSaveSplitInt = '';
1513   - textArrVal = '';
1514   - $("#annotationTextModal").css("padding-right", "0px");
1515   - document.getElementById('modelbackground').style.display = "block";
1516   - $("#annotationTextModal").modal("toggle");
1517 1661  
1518   - // $("#selected-font-family").val(CurrentFontFamily);
1519   - // $("#selected-font-size").val(CurrentFontSize);
  1662 + // _rectLayerOnSaveSplitInt = '';
  1663 + textArrVal = '';
  1664 + $("#annotationTextModal").css("padding-right", "0px");
  1665 + document.getElementById('modelbackground').style.display = "block";
  1666 + $("#annotationTextModal").modal("toggle");
1520 1667  
  1668 + // $("#selected-font-family").val(CurrentFontFamily);
  1669 + // $("#selected-font-size").val(CurrentFontSize);
  1670 + }
  1671 + else {
  1672 + //jcanvas property
  1673 + layer.draggable = false;
  1674 + }
1521 1675  
1522 1676 },
1523 1677 mouseout: function (layer) {
1524   - $rootScope.canvasLayerNameCollection = [];
1525   - $('#canvas').setLayer(layer.name, {
1526   - handle: {
1527   - type: 'rectangle',
1528   - fillStyle: 'pink',
1529   - strokeStyle: 'yellow',
1530   - strokeWidth: 0,
1531   - width: 0, height: 0,
1532   - cornerRadius: 0
1533   - }
1534   - }).drawLayers();
  1678 + if ($rootScope.isAnnotaionToolBarDrawingModeActive == true) {
  1679 + //jcanvas property
  1680 + layer.draggable = true;
  1681 + $rootScope.canvasLayerNameCollection = [];
  1682 + $('#canvas').setLayer(layer.name, {
  1683 + handle: {
  1684 + type: 'rectangle',
  1685 + fillStyle: 'pink',
  1686 + strokeStyle: 'yellow',
  1687 + strokeWidth: 0,
  1688 + width: 0, height: 0,
  1689 + cornerRadius: 0
  1690 + }
  1691 + }).drawLayers();
  1692 + }
  1693 + else {
  1694 + //jcanvas property
  1695 + layer.draggable = false;
  1696 + }
1535 1697 },
1536 1698 mouseover: function (layer) {
1537   - $('#canvas').setLayer(layer.name, {
1538   - handle: {
1539   - type: 'rectangle',
1540   - fillStyle: '#fff',
1541   - strokeStyle: '#c33',
1542   - strokeWidth: 2,
1543   - width: 5, height: 5,
1544   - cornerRadius: 3
1545   - }
1546   - }).drawLayers();
1547   -
  1699 + if ($rootScope.isAnnotaionToolBarDrawingModeActive == true) {
  1700 + //jcanvas property
  1701 + layer.draggable = true;
  1702 + $('#canvas').setLayer(layer.name, {
  1703 + handle: {
  1704 + type: 'rectangle',
  1705 + fillStyle: '#fff',
  1706 + strokeStyle: '#c33',
  1707 + strokeWidth: 2,
  1708 + width: 5, height: 5,
  1709 + cornerRadius: 3
  1710 + }
  1711 + }).drawLayers();
  1712 + }
  1713 + else {
  1714 + //jcanvas property
  1715 + layer.draggable = false;
  1716 + }
1548 1717 }
1549 1718 });
1550 1719 $("#text_area").val('');
... ... @@ -1633,148 +1802,181 @@ AIA.controller(&quot;HomeController&quot;, [&quot;$rootScope&quot;, &quot;Modules&quot;, &quot;$log&quot;, &quot;$location&quot;,
1633 1802 height: $rootScope.rectDimension[$rootScope.rectDimension.length - 1].height,
1634 1803 resizeFromCenter: false,
1635 1804 click: function (layer) {
1636   - $rootScope.shapeTypeText = "textAreaRect";
1637   - var layerNameSplit = layer.name;
1638   - var splitedName = layerNameSplit.split("_");
1639   - var textValName = "TextAreaAfterEdit_";
1640   - var concatinateResult = textValName.concat(splitedName[1]);
1641   - $rootScope.canvasLayerNameCollection = [];
1642   - $rootScope.canvasLayerNameCollection.push({ textareaRectangle: layer.name, textareaString: concatinateResult });
1643   -
1644   - $('#canvas').setLayer(layer.name, {
1645   - handle: {
1646   - type: 'rectangle',
1647   - fillStyle: '#fff',
1648   - strokeStyle: '#c33',
1649   - strokeWidth: 2,
1650   - width: 5, height: 5,
1651   - cornerRadius: 3
1652   - }
1653   - }).drawLayers();
  1805 + if ($rootScope.isAnnotaionToolBarDrawingModeActive == true) {
  1806 + //jcanvas property
  1807 + layer.draggable = true;
  1808 + $rootScope.shapeTypeText = "textAreaRect";
  1809 + var layerName = layer.name;
  1810 + var splitedName = layerName.split("_");
  1811 + var textValName = "TextAreaAfterEdit_";
  1812 + var concatinateResult = textValName.concat(splitedName[1]);
  1813 + $rootScope.canvasLayerNameCollection = [];
  1814 + $rootScope.canvasLayerNameCollection.push({ textareaRectangle: layer.name, textareaString: concatinateResult });
  1815 +
  1816 + $('#canvas').setLayer(layer.name, {
  1817 + handle: {
  1818 + type: 'rectangle',
  1819 + fillStyle: '#fff',
  1820 + strokeStyle: '#c33',
  1821 + strokeWidth: 2,
  1822 + width: 5, height: 5,
  1823 + cornerRadius: 3
  1824 + }
  1825 + }).drawLayers();
  1826 + }
  1827 + else {
  1828 + //jcanvas property
  1829 + layer.draggable = false;
  1830 + }
1654 1831  
1655 1832 },
1656 1833 dblclick: function (layer) {
1657 1834  
  1835 + if ($rootScope.isAnnotaionToolBarDrawingModeActive == true) {
  1836 + //jcanvas property
  1837 + layer.draggable = true;
  1838 + $rootScope.isTextAreaClosedButtonActive = false;
  1839 + $rootScope.IsTextAlreadySave = true;
  1840 + var _rectLayerOnSave = layer.name;
  1841 + var _rectLayerOnSaveSplit = _rectLayerOnSave.split("_");
  1842 + var RectNameAfterEdit = "TextAreaAfterEdit_";
  1843 + var RectNameAfterEditResult = RectNameAfterEdit.concat(_rectLayerOnSaveSplit[1]);
  1844 + $rootScope.modifySavedTextIndexNumber = _rectLayerOnSaveSplit[1];
  1845 +
  1846 + $rootScope.layerNameArr = layer.name;
  1847 + $rootScope.rectTextArr = RectNameAfterEditResult;
  1848 +
  1849 + $rootScope.rectDimension.push({ width: layer.width, height: layer.height, x: layer.x, y: layer.y });
  1850 + $("#text_area").val(_modifiedText);
  1851 + $("#text_area").css("font-size", _modifiedFontSize);
  1852 + $("#text_area").css("font-weight", _modifiedFontWeight);
  1853 + $("#text_area").css("font-style", _modifiedFontStyle);
  1854 + $("#text_area").css("text-align", _modifiedTextAlign);
  1855 + $("#text_area").css("color", _modifiedFontColor);
  1856 + $("#text_area").css("font-family", _modifiedFontFamily);
  1857 + $("#text_area").css("text-decoration", _modifiedFontDecoration);
  1858 + $("#font-color .minicolors .minicolors-swatch .minicolors-swatch-color").css({ "background-color": _modifiedFontColor });
  1859 +
  1860 + // $(".ActiveDefaultColorAnnotation").css({ "background-color": _modifiedFontColor + "!important" });
  1861 + // $("#font-color .minicolors .minicolors-swatch .minicolors-swatch-color").addClass("ActiveDefaultColorAnnotation");
  1862 +
  1863 + //khushbu
  1864 + var CurrentFontFamily = _modifiedFontFamily;
  1865 + // alert(CurrentFontFamily);
  1866 + // CurrentFontFamily = CurrentFontFamily.replace(/'/g, "");
  1867 + var CurrentFontSize = parseInt(_modifiedFontSize);
  1868 + $("#selected-font-family option[value=" + CurrentFontFamily + "]").prop('selected', true);
  1869 + $("#selected-font-size option[value=" + CurrentFontSize + "]").prop('selected', true);
  1870 + CurrentFontFamily = '';
  1871 + CurrentFontSize = '';
  1872 + //adding text text decoration active class in text edit pop-up
  1873 + if (_modifiedFontDecoration == "underline") {
  1874 + $("#text-underline").addClass("ActiveFormattingButtonClass");
  1875 + }
  1876 + else {
  1877 + $("#text-underline").removeClass("ActiveFormattingButtonClass");
  1878 + }
1658 1879  
1659   - $rootScope.isTextAreaClosedButtonActive = false;
1660   - $rootScope.IsTextAlreadySave = true;
1661   - var _rectLayerOnSave = layer.name;
1662   - var _rectLayerOnSaveSplit = _rectLayerOnSave.split("_");
1663   - var RectNameAfterEdit = "TextAreaAfterEdit_";
1664   - var RectNameAfterEditResult = RectNameAfterEdit.concat(_rectLayerOnSaveSplit[1]);
1665   - $rootScope.modifySavedTextIndexNumber = _rectLayerOnSaveSplit[1];
1666   -
1667   - $rootScope.layerNameArr = layer.name;
1668   - $rootScope.rectTextArr = RectNameAfterEditResult;
1669   -
1670   - $rootScope.rectDimension.push({ width: layer.width, height: layer.height, x: layer.x, y: layer.y });
1671   - $("#text_area").val(_modifiedText);
1672   - $("#text_area").css("font-size", _modifiedFontSize);
1673   - $("#text_area").css("font-weight", _modifiedFontWeight);
1674   - $("#text_area").css("font-style", _modifiedFontStyle);
1675   - $("#text_area").css("text-align", _modifiedTextAlign);
1676   - $("#text_area").css("color", _modifiedFontColor);
1677   - $("#text_area").css("font-family", _modifiedFontFamily);
1678   - $("#text_area").css("text-decoration", _modifiedFontDecoration);
1679   - $("#font-color .minicolors .minicolors-swatch .minicolors-swatch-color").css({ "background-color": _modifiedFontColor });
1680   -
1681   - // $(".ActiveDefaultColorAnnotation").css({ "background-color": _modifiedFontColor + "!important" });
1682   - // $("#font-color .minicolors .minicolors-swatch .minicolors-swatch-color").addClass("ActiveDefaultColorAnnotation");
1683   -
1684   - //khushbu
1685   - var CurrentFontFamily = _modifiedFontFamily;
1686   - // alert(CurrentFontFamily);
1687   - // CurrentFontFamily = CurrentFontFamily.replace(/'/g, "");
1688   - var CurrentFontSize = parseInt(_modifiedFontSize);
1689   - $("#selected-font-family option[value=" + CurrentFontFamily + "]").prop('selected', true);
1690   - $("#selected-font-size option[value=" + CurrentFontSize + "]").prop('selected', true);
1691   - CurrentFontFamily = '';
1692   - CurrentFontSize = '';
1693   - //adding text text decoration active class in text edit pop-up
1694   - if (_modifiedFontDecoration == "underline") {
1695   - $("#text-underline").addClass("ActiveFormattingButtonClass");
1696   - }
1697   - else {
1698   - $("#text-underline").removeClass("ActiveFormattingButtonClass");
1699   - }
  1880 + //adding text font weight active class in text edit pop-up
  1881 + if (_modifiedFontWeight == 700) {
1700 1882  
1701   - //adding text font weight active class in text edit pop-up
1702   - if (_modifiedFontWeight == 700) {
  1883 + $("#text-bold").addClass("ActiveFormattingButtonClass");
  1884 + }
  1885 + else {
1703 1886  
1704   - $("#text-bold").addClass("ActiveFormattingButtonClass");
1705   - }
1706   - else {
  1887 + $("#text-bold").removeClass("ActiveFormattingButtonClass");
1707 1888  
1708   - $("#text-bold").removeClass("ActiveFormattingButtonClass");
  1889 + }
1709 1890  
1710   - }
  1891 + //adding text font style active class in text edit pop-up
  1892 + if (_modifiedFontStyle == "italic") {
1711 1893  
1712   - //adding text font style active class in text edit pop-up
1713   - if (_modifiedFontStyle == "italic") {
  1894 + $("#text-italic").addClass("ActiveFormattingButtonClass");
  1895 + }
  1896 + else {
  1897 + $("#text-italic").removeClass("ActiveFormattingButtonClass");
1714 1898  
1715   - $("#text-italic").addClass("ActiveFormattingButtonClass");
1716   - }
1717   - else {
1718   - $("#text-italic").removeClass("ActiveFormattingButtonClass");
  1899 + }
1719 1900  
1720   - }
  1901 + //adding text alignment active class in text edit pop-up
  1902 + if (_modifiedTextAlign == "left") {
  1903 + $("#text-right").removeClass("ActiveFormattingButtonClass");
  1904 + $("#text-center").removeClass("ActiveFormattingButtonClass")
  1905 + $("#text-left").addClass("ActiveFormattingButtonClass");
  1906 + }
  1907 + else if (_modifiedTextAlign == "right") {
1721 1908  
1722   - //adding text alignment active class in text edit pop-up
1723   - if (_modifiedTextAlign == "left") {
1724   - $("#text-right").removeClass("ActiveFormattingButtonClass");
1725   - $("#text-center").removeClass("ActiveFormattingButtonClass")
1726   - $("#text-left").addClass("ActiveFormattingButtonClass");
1727   - }
1728   - else if (_modifiedTextAlign == "right") {
  1909 + $("#text-center").removeClass("ActiveFormattingButtonClass")
  1910 + $("#text-left").removeClass("ActiveFormattingButtonClass");
  1911 + $("#text-right").addClass("ActiveFormattingButtonClass");
1729 1912  
1730   - $("#text-center").removeClass("ActiveFormattingButtonClass")
1731   - $("#text-left").removeClass("ActiveFormattingButtonClass");
1732   - $("#text-right").addClass("ActiveFormattingButtonClass");
  1913 + }
  1914 + else if (_modifiedTextAlign == "center") {
  1915 + $("#text-left").removeClass("ActiveFormattingButtonClass");
  1916 + $("#text-right").removeClass("ActiveFormattingButtonClass");
  1917 + $("#text-center").addClass("ActiveFormattingButtonClass");
1733 1918  
1734   - }
1735   - else if (_modifiedTextAlign == "center") {
1736   - $("#text-left").removeClass("ActiveFormattingButtonClass");
1737   - $("#text-right").removeClass("ActiveFormattingButtonClass");
1738   - $("#text-center").addClass("ActiveFormattingButtonClass");
  1919 + }
1739 1920  
  1921 + document.getElementById('modelbackground').style.display = "block";
  1922 + $("#annotationTextModal").modal("toggle");
1740 1923 }
1741   -
1742   - document.getElementById('modelbackground').style.display = "block";
1743   - $("#annotationTextModal").modal("toggle");
  1924 + else {
  1925 + //jcanvas property
  1926 + layer.draggable = false;
  1927 + }
1744 1928 },
1745 1929 mouseout: function (layer) {
1746   - $rootScope.canvasLayerNameCollection = [];
1747   - $('#canvas').setLayer(layer.name, {
1748   - handle: {
1749   - type: 'rectangle',
1750   - fillStyle: 'pink',
1751   - strokeStyle: 'yellow',
1752   - strokeWidth: 0,
1753   - width: 0, height: 0,
1754   - cornerRadius: 0
1755   - }
1756   - }).drawLayers();
  1930 + if ($rootScope.isAnnotaionToolBarDrawingModeActive == true) {
  1931 + //jcanvas property
  1932 + layer.draggable = true;
  1933 + $rootScope.canvasLayerNameCollection = [];
  1934 + $('#canvas').setLayer(layer.name, {
  1935 + handle: {
  1936 + type: 'rectangle',
  1937 + fillStyle: 'pink',
  1938 + strokeStyle: 'yellow',
  1939 + strokeWidth: 0,
  1940 + width: 0, height: 0,
  1941 + cornerRadius: 0
  1942 + }
  1943 + }).drawLayers();
  1944 + }
  1945 + else {
  1946 + //jcanvas property
  1947 + layer.draggable = false;
  1948 + }
1757 1949 },
1758 1950 mouseover: function (layer) {
1759   - $('#canvas').setLayer(layer.name, {
1760   - handle: {
1761   - type: 'rectangle',
1762   - fillStyle: '#fff',
1763   - strokeStyle: '#c33',
1764   - strokeWidth: 2,
1765   - width: 5, height: 5,
1766   - cornerRadius: 3
1767   - }
1768   - }).drawLayers();
  1951 + if ($rootScope.isAnnotaionToolBarDrawingModeActive == true) {
  1952 + //jcanvas property
  1953 + layer.draggable = true;
  1954 + $('#canvas').setLayer(layer.name, {
  1955 + handle: {
  1956 + type: 'rectangle',
  1957 + fillStyle: '#fff',
  1958 + strokeStyle: '#c33',
  1959 + strokeWidth: 2,
  1960 + width: 5, height: 5,
  1961 + cornerRadius: 3
  1962 + }
  1963 + }).drawLayers();
  1964 +
  1965 + }
1769 1966  
  1967 + else {
  1968 + //jcanvas property
  1969 + layer.draggable = false;
  1970 + }
1770 1971 }
  1972 +
1771 1973 });
1772 1974  
1773 1975 }
1774 1976 }
1775 1977 //----
1776 1978  
1777   - $rootScope.BindCanvasDrawingListners = function (event) {
  1979 + $rootScope.onDrawingCanvasClick = function (event) {
1778 1980  
1779 1981 $rootScope.clicked = true;
1780 1982 // OnPaintCanvasMouseDown(event);
... ... @@ -1785,6 +1987,16 @@ AIA.controller(&quot;HomeController&quot;, [&quot;$rootScope&quot;, &quot;Modules&quot;, &quot;$log&quot;, &quot;$location&quot;,
1785 1987 annotationCanvas.addEventListener('mouseup', $rootScope.OnPaintCanvasMouseUp, false);
1786 1988 }
1787 1989 // alert("doclick");
  1990 + // annotation history
  1991 + if (event != undefined) {
  1992 + if ($rootScope.isAnnotaionToolBarDrawingModeActive == false) {
  1993 +
  1994 + $rootScope.getAnnotationTextBasedOnSelectedBodyRegion(event);
  1995 +
  1996 + }
  1997 + }
  1998 +
  1999 +
1788 2000 };
1789 2001  
1790 2002  
... ... @@ -2156,12 +2368,25 @@ AIA.controller(&quot;HomeController&quot;, [&quot;$rootScope&quot;, &quot;Modules&quot;, &quot;$log&quot;, &quot;$location&quot;,
2156 2368 $rootScope.FreeStylePaint = function (e) {
2157 2369  
2158 2370 var annotationCanvas = document.getElementById("canvas");
  2371 + annotationCanvas.addEventListener('mousedown', $rootScope.OnPaintBrushCanvasMouseDown, false);
  2372 + annotationCanvas.addEventListener('mouseup', $rootScope.OnPaintBrushCanvasMouseUp, false);
2159 2373 // document.getElementById("canvasPaint").addEventListener("mouseup", OnPaintBrushCanvasMouseUp);
  2374 + //alert($rootScope.isAnnotaionToolBarDrawingModeActive);
  2375 + //if ($rootScope.isAnnotaionToolBarDrawingModeActive == true) {
2160 2376  
2161   - annotationCanvas.addEventListener('mousedown', $rootScope.OnPaintBrushCanvasMouseDown, false);
  2377 + // alert($rootScope.isAnnotaionToolBarDrawingModeActive);
  2378 + // $rootScope.getAnnotationTextBasedOnSelectedBodyRegion(e);
2162 2379  
2163   - annotationCanvas.addEventListener('mouseup', $rootScope.OnPaintBrushCanvasMouseUp, false);
2164   - }
  2380 + //}
  2381 + //else {
  2382 +
  2383 +
  2384 +
  2385 + //}
  2386 + }
  2387 +
  2388 +
  2389 +
2165 2390  
2166 2391  
2167 2392  
... ...
400-SOURCECODE/AIAHTML5.Web/app/views/da/da-view.html
... ... @@ -328,7 +328,7 @@
328 328 <div class="row">
329 329 <div id="canvasDiv" class="col-sm-12 img-thumbnail" align="center">
330 330 <canvas id="canvasPaint" ng-click="FreeStylePaint($event)" width="2277" height="3248" class="canvas-annotationStyle1"></canvas>
331   - <canvas id="canvas" ng-click="BindCanvasDrawingListners($event)" width="2277" height="3248" class="canvas-annotationStyle"></canvas>
  331 + <canvas id="canvas" ng-click="onDrawingCanvasClick($event)" width="2277" height="3248" class="canvas-annotationStyle"></canvas>
332 332 </div>
333 333 <!--<div id="canvasDiv" style=" width: 95% !important;top:0px;overflow:scroll;background-color:white;">-->
334 334 <!--<div id="daLoaderLabel">Loading....</div>-->
... ...