Commit 79a260faa30ecacbd91771e3f57598cddcc28beb

Authored by Birendra
1 parent b19c0c5f

fixedmore bug in all module for touch screen

400-SOURCECODE/AIAHTML5.Web/app/controllers/3dAController.js
... ... @@ -600,13 +600,14 @@ function ($scope, $rootScope, pages, log, $http, DataService, $filter, $location
600 600  
601 601 //click event not work on object-tag document
602 602 //so then add mouseenter
603   - $("#ThreeDImagePanel_" + windowviewid).unbind('mouseenter');// remove prev event
  603 + //remove pre event
  604 + $("#ThreeDImagePanel_" + windowviewid).off("mouseenter mouseout touchstart touchcancel");
604 605  
605   - $("#ThreeDImagePanel_" + windowviewid).on('mouseenter', function (event) {
  606 + $("#ThreeDImagePanel_" + windowviewid).on('mouseenter mouseout touchstart touchcancel', function (event) {
  607 + //after drawing annotation click not work on iPad/Android device
606 608 var pnlName = event.currentTarget.id;
607   - $rootScope.resetMenuOptionOnClick(pnlName);
608   -
609   - });
  609 + $rootScope.resetMenuOptionOnClick(pnlName);
  610 + });
610 611  
611 612 }
612 613  
... ...
400-SOURCECODE/AIAHTML5.Web/app/controllers/AIController.js
... ... @@ -1119,8 +1119,8 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout
1119 1119 }
1120 1120 }
1121 1121 else {
1122   - $scope.jsPanelWidth = $(window).outerWidth() - 30;
1123   - $scope.jsPanelHeight = $(window).outerHeight() - 150;
  1122 + $scope.jsPanelWidth = $(window).innerWidth() - 30;
  1123 + $scope.jsPanelHeight = $(window).innerHeight() - 150;
1124 1124 $scope.jsPanelLeft = 15;
1125 1125 $scope.jsPanelTop = 70;
1126 1126 }
... ... @@ -1132,10 +1132,10 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout
1132 1132 theme: 'success',
1133 1133 currentController: 'AIController',
1134 1134 parentSlug: $scope.GetAIwindowStoreData(windowviewid, 'parentSlugName'),
1135   - content: '<div class="col-sm-12">'+
  1135 + content: '<div>'+
1136 1136 ' <div class="container-fluid">'+
1137 1137 ' <div class="row">'+
1138   - '<div class=" col-sm-12 img-thumbnail" style="overflow: scroll;" id="canvasDivAI_' + windowviewid + '" ><canvas id="canvasPaintAI_' + windowviewid + '" ng-click="FreeStylePaint($event)" width="2270" height="800" class="canvas-annotationStyle1" style="position: absolute;z-index:0;left:0px"></canvas><canvas id="canvasAI_' + windowviewid + '" ng-click="onDrawingCanvasClick($event)" width="2270" height="800" class="canvas-annotationStyle" style="position: absolute; background-color: transparent;z-index:1;left:0px "></canvas>' +
  1138 + '<div class="img-thumbnail" style="overflow: scroll;width:100%;position:relative" id="canvasDivAI_' + windowviewid + '" ><canvas id="canvasPaintAI_' + windowviewid + '" ng-click="FreeStylePaint($event)" width="2270" height="800" class="canvas-annotationStyle1" style="position: absolute;z-index:0;left:0px"></canvas><canvas id="canvasAI_' + windowviewid + '" ng-click="onDrawingCanvasClick($event)" width="2270" height="800" class="canvas-annotationStyle" style="position: absolute; background-color: transparent;z-index:1;left:0px "></canvas>' +
1139 1139 '<img id="aimage_' + windowviewid + '" alt="" title="" style="left:0px;top:0px;position:absolute;visibility:hidden">' +
1140 1140 '</div>'+
1141 1141 '</div></div></div>',
... ... @@ -1224,9 +1224,9 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout
1224 1224 $('.jsPanel-content .jsPanel-theme-success').css('overflow-y', 'auto !important')
1225 1225 var canvasDIvHeight = $('#aiImagePanel_' + windowviewid+ " .jsPanel-content").height();
1226 1226 // console.log($rootScope.OpenAdamImages);
1227   - $('#AIView').css("height", $(window).outerHeight() - 65);
  1227 + $('#AIView').css("height", $(window).innerHeight()-100);
1228 1228  
1229   - $('#AIView').css("width", $(window).outerWidth() - 15);
  1229 + $('#AIView').css("width",$(window).innerWidth()-100);
1230 1230  
1231 1231 $('#canvasDivAI_' + windowviewid).css('height', canvasDIvHeight);
1232 1232  
... ... @@ -1234,10 +1234,10 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout
1234 1234 var canvas = document.getElementById("canvasAI_" + windowviewid);
1235 1235 var canvasPaint = document.getElementById("canvasPaintAI_" + windowviewid);
1236 1236  
1237   - canvas.height = canvasDIvHeight-20;
1238   - canvasPaint.height = canvasDIvHeight-20;
1239   - canvas.width = screen.width-70;
1240   - canvasPaint.width = screen.width-70;
  1237 + canvas.height = canvasDIvHeight;
  1238 + canvasPaint.height = canvasDIvHeight
  1239 + canvas.width = screen.width;
  1240 + canvasPaint.width = screen.width;
1241 1241 }
1242 1242  
1243 1243  
... ... @@ -1321,25 +1321,26 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout
1321 1321 }
1322 1322 }
1323 1323  
1324   - $scope.JsPanelclick = function (windowviewid) {
1325   -
  1324 + $scope.JsPanelclick = function (windowviewid) {
1326 1325 //reset option list manager and annotation
1327 1326 //call when module loaded
1328 1327 $rootScope.resetMenuOption();
1329 1328  
1330   - // call from while open module in CB
1331   - $("#aiImagePanel_" + windowviewid).on('click', function (event) {
  1329 + //remove pre event
  1330 + $("#aiImagePanel_" + windowviewid).off("click touchstart");
1332 1331  
  1332 + $("#aiImagePanel_" + windowviewid).on('click touchstart', function (event) {
  1333 + //after drawing annotation click not work on iPad/Android device
1333 1334 var pnlName = event.currentTarget.id;
1334 1335 $rootScope.resetMenuOptionOnClick(pnlName);
1335   -
1336 1336 // store image for export while click on panel
1337   -
1338 1337 var currentViewTitle = $scope.GetAIwindowStoreData(windowviewid, 'currentViewTitle');
1339 1338 var imageName = $scope.GetAIwindowStoreData(windowviewid, 'imageName');
1340 1339 $rootScope.StoreTitleName(currentViewTitle);
1341 1340 $rootScope.StoreOrgImageName(imageName);
  1341 +
1342 1342 });
  1343 +
1343 1344 }
1344 1345  
1345 1346 }]
... ...
400-SOURCECODE/AIAHTML5.Web/app/controllers/CAController.js
... ... @@ -952,7 +952,7 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout
952 952 ' kind="captions" srclang="en" label="On"><object width="640" height="360"' +
953 953 ' type="application/x-shockwave-flash" data="//vjs.zencdn.net/3.2/video-js.swf"><param name="allowfullscreen" value="true">' +
954 954 ' <param name="allowscriptaccess" value="always"><param name="movie" value="//vjs.zencdn.net/3.2/video-js.swf">' +
955   - ' <param name="flashvars" ng-value="controls=true&amp;file=' + clickedCAVideo + '"><img ng-src="content/images/common/player/frameaccuracy_logo.jpg" style="height:80%;" alt="Here we are" title="No video playback capabilities"></object></video><div class="col-sm-12 well video-subtitle"><div id="sid_' + windowviewid + '" align="left" style="height:60px;overflow-y:scroll !important;-webkit-overflow-scrolling:touch !important;"><p>' + clickedCASummary + '</p></div><button id="btnTxtOnOff_' + windowviewid + '" class="btn btn-primary pull-right">Text Off</button></div></div></div>',
  955 + ' <param name="flashvars" ng-value="controls=true&amp;file=' + clickedCAVideo + '"><img ng-src="content/images/common/player/frameaccuracy_logo.jpg" style="height:80%;" alt="Here we are" title="No video playback capabilities"></object></video><div class="col-sm-12 well video-subtitle"><div id="sid_' + windowviewid + '" align="left" style="height:60px;overflow-y:scroll !important;-webkit-overflow-scrolling:touch !important;"><p>' + clickedCASummary + '</p></div><button id="btnTxtOnOff_' + windowviewid + '" class="btn btn-primary pull-right" style="position:relative;top:0px">Text Off</button></div></div></div>',
956 956  
957 957 title: tittle,
958 958 position: {
... ... @@ -971,7 +971,7 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout
971 971 $rootScope.UnsaveCurriculum = true;
972 972 }
973 973 $scope.SetCAwindowStoreData(windowviewid, 'minimised',true);
974   - $scope.SetCAwindowStoreData(windowviewid, 'maximised',false);
  974 + $scope.SetCAwindowStoreData(windowviewid, 'maximised',false);
975 975 },
976 976 onmaximized:function (panel) {
977 977 var isAutoCalled = $scope.GetCAwindowStoreData(windowviewid, 'minmaxAutoEvent');
... ... @@ -981,6 +981,8 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout
981 981 }
982 982 $scope.SetCAwindowStoreData(windowviewid, 'maximised',true);
983 983 $scope.SetCAwindowStoreData(windowviewid, 'minimised',false);
  984 + var canvasDIvHeight = $('#caImagePanel_' + windowviewid+ " .jsPanel-content").height();
  985 + $('#playerinlineVideo_'+ windowviewid ).css("height",canvasDIvHeight-120 );
984 986 },
985 987 onnormalized:function (panel) {
986 988 var isAutoCalled = $scope.GetCAwindowStoreData(windowviewid, 'minmaxAutoEvent');
... ... @@ -990,6 +992,8 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout
990 992 }
991 993 $scope.SetCAwindowStoreData(windowviewid, 'minimised',false);
992 994 $scope.SetCAwindowStoreData(windowviewid, 'maximised',false);
  995 + var canvasDIvHeight = $('#caImagePanel_' + windowviewid+ " .jsPanel-content").height();
  996 + $('#playerinlineVideo_'+ windowviewid ).css("height",canvasDIvHeight-120 );
993 997 },
994 998 resizable: {
995 999 stop: function (event, ui) {
... ... @@ -1059,12 +1063,17 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout
1059 1063 var $ua = navigator.userAgent;
1060 1064 if (($ua.match(/(iPod|iPhone|iPad|android)/i))) { $('.jsPanel-content').css("width", "100%"); }
1061 1065 }
  1066 +
  1067 + if(screen.height<=640)
  1068 + {
  1069 + $('#btnTxtOnOff_' + windowviewid).css("top", "-15px");
  1070 + }
  1071 +
1062 1072  
1063 1073 }
1064 1074  
1065 1075 if (!$rootScope.isCallFromOtherModule) {
1066 1076 $('#CAView').css("height", $(window).outerHeight() - 20);
1067   -
1068 1077 $('#CAView').css("width", $(window).outerWidth() - 30);
1069 1078  
1070 1079 }
... ... @@ -1081,17 +1090,17 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout
1081 1090 $rootScope.CAWindowLoadComplete = true;
1082 1091 }
1083 1092 $scope.JsPanelclick(windowviewid);
1084   -
1085   - var isTextVisible = $scope.GetCAwindowStoreData(windowviewid, 'isTextVisible');
1086   -
1087 1093  
  1094 + var isTextVisible = $scope.GetCAwindowStoreData(windowviewid, 'isTextVisible');
1088 1095 if(isTextVisible)
1089 1096 {
1090   - $("#btnTxtOnOff_" + windowviewid).text("Text Off"); $("#sid_" + windowviewid).css("visibility", "visible");
  1097 + $("#btnTxtOnOff_" + windowviewid).text("Text Off");
  1098 + $("#sid_" + windowviewid).css("visibility", "visible");
1091 1099 }
1092 1100 else
1093 1101 {
1094   - $("#btnTxtOnOff_" + windowviewid).text("Text On"); $("#sid_" + windowviewid).css("visibility", "hidden");
  1102 + $("#btnTxtOnOff_" + windowviewid).text("Text On");
  1103 + $("#sid_" + windowviewid).css("visibility", "hidden");
1095 1104  
1096 1105 }
1097 1106  
... ... @@ -1103,10 +1112,13 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout
1103 1112 //call when module loaded
1104 1113 $rootScope.resetMenuOption();
1105 1114 // call from while open module in CB
1106   - $("#caImagePanel_" + windowviewid).on('click', function (event) {
1107   - var pnlName = event.currentTarget.id;
1108   - $rootScope.resetMenuOptionOnClick(pnlName);
1109   -
  1115 + //remove pre event
  1116 + $("#caImagePanel_" + windowviewid).off("click touchstart");
  1117 +
  1118 + $("#caImagePanel_" + windowviewid).on('click touchstart', function (event) {
  1119 + //after drawing annotation click not work on iPad/Android device
  1120 + var pnlName = event.currentTarget.id;
  1121 + $rootScope.resetMenuOptionOnClick(pnlName);
1110 1122 });
1111 1123 }
1112 1124  
... ...
400-SOURCECODE/AIAHTML5.Web/app/controllers/CIController.js
... ... @@ -904,14 +904,14 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout
904 904 theme: 'success',
905 905 currentController: 'CIController',
906 906 parentSlug: $scope.GetCIwindowStoreData(windowviewid, 'parentSlugName'),
907   - content:'<div class="col-sm-12">'+
  907 + content:'<div>'+
908 908 ' <div class="container-fluid">'+
909 909 ' <div class="row">'+
910   - '<div class=" col-sm-12 img-thumbnail" style="overflow: scroll;" id="canvasDivCI_' + windowviewid + '"> <canvas id="canvasPaintCI_' + windowviewid + '" ng-click="FreeStylePaint($event)" width="2270" height="700" class="canvas-annotationStyle1" style="position: absolute;z-index:0;left:0px"></canvas><canvas id="canvasCI_' + windowviewid + '" ng-click="onDrawingCanvasClick($event)" width="2270" height="700" class="canvas-annotationStyle" style="position: absolute; background-color: transparent;z-index:1;left:0px "></canvas>' +
  910 + '<div class="img-thumbnail" style="overflow: hidden;width:100%;position:relative" id="canvasDivCI_' + windowviewid + '"> <canvas id="canvasPaintCI_' + windowviewid + '" ng-click="FreeStylePaint($event)" width="2270" height="700" class="canvas-annotationStyle1" style="position: absolute;z-index:0;left:0px"></canvas><canvas id="canvasCI_' + windowviewid + '" ng-click="onDrawingCanvasClick($event)" width="2270" height="700" class="canvas-annotationStyle" style="position: absolute; background-color: transparent;z-index:1;left:0px "></canvas>' +
911 911 //'<div class="col-sm-12 img-thumbnail" align="center">' +
912 912 '<img id="ciimage_' + windowviewid + '" alt="" title="" style="left:0px;top:0px;position:absolute;visibility:hidden">' +
913   - '<div id="summary_' + windowviewid + '" class="col-sm-12 well img-subtitle" style="left:0px;height: 150px; overflow: scroll;bottom:0px;position:absolute">' +
914   - '<div align="left" id="sid_' + windowviewid + '"><p>' + selectedImageCISummary + '</p></div><button id="btnTxtOnOff_' + windowviewid + '" class="btn btn-primary pull-right">Text Off</button>' +
  913 + '<div id="summary_' + windowviewid + '" class="col-sm-12 well img-subtitle" style="position:absolute;bottom:0px;margin-bottom:0px;padding:5px;width:100%">' +
  914 + '<div id="sid_' + windowviewid + '" align="left" style="height:100px;overflow-y:scroll !important;-webkit-overflow-scrolling:touch !important;"><p>' + selectedImageCISummary + '</p></div><button id="btnTxtOnOff_' + windowviewid + '" class="btn btn-primary pull-right">Text Off</button>' +
915 915 '<script>$(document).ready(function(){ var $ua = navigator.userAgent;if(($ua.match(/(iPod|iPhone|iPad|android)/i))) { var jspanelContainerWidth = $(".jsPanel-content").css("width"); $(".jsPanel-content").css({ "width": "100%", "min-width": jspanelContainerWidth });$("#' + $scope.jsPanelID + '").css("width", "100%"); }$("#btnTxtOnOff_' + windowviewid + '").click(function(){if($.trim($(this).text()) === "Text Off"){$(this).text("Text On");$("#sid_' + windowviewid + '").css("visibility","hidden");}else{$(this).text("Text Off");$("#sid_' + windowviewid + '").css("visibility","visible");} GetTextVisibityCI(event);});});</script></div>' +
916 916 '</div>'+
917 917 '</div></div></div>',
... ... @@ -942,6 +942,8 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout
942 942 }
943 943 $scope.SetCIwindowStoreData(windowviewid, 'maximised',true);
944 944 $scope.SetCIwindowStoreData(windowviewid, 'minimised',false);
  945 + var canvasDIvHeight = $('#ciImagePanel_' + windowviewid+ " .jsPanel-content").height();
  946 + $('#canvasDivCI_' + windowviewid).css('height', canvasDIvHeight);
945 947 },
946 948 onnormalized:function (panel) {
947 949 var isAutoCalled = $scope.GetCIwindowStoreData(windowviewid, 'minmaxAutoEvent');
... ... @@ -951,6 +953,8 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout
951 953 }
952 954 $scope.SetCIwindowStoreData(windowviewid, 'minimised',false);
953 955 $scope.SetCIwindowStoreData(windowviewid, 'maximised',false);
  956 + var canvasDIvHeight = $('#ciImagePanel_' + windowviewid+ " .jsPanel-content").height();
  957 + $('#canvasDivCI_' + windowviewid).css('height', canvasDIvHeight);
954 958 },
955 959 resizable: {
956 960 stop: function (event, ui) {
... ... @@ -1019,11 +1023,15 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout
1019 1023  
1020 1024 var canvas = document.getElementById("canvasCI_" + windowviewid);
1021 1025 var canvasPaint = document.getElementById("canvasPaintCI_" + windowviewid);
1022   - canvas.height = canvasDIvHeight-200;
1023   - canvasPaint.height = canvasDIvHeight-200;
1024   - canvas.width = screen.width-70;
1025   - canvasPaint.width = screen.width-70;
1026   -
  1026 + canvas.height = canvasDIvHeight;
  1027 + canvasPaint.height = canvasDIvHeight;
  1028 + canvas.width = screen.width-20;
  1029 + canvasPaint.width = screen.width-20;
  1030 + if(screen.height<400)
  1031 + {
  1032 + $('#summary_' + windowviewid).css("bottom", "-220px");
  1033 + }
  1034 +
1027 1035 }
1028 1036  
1029 1037 var openedImage = document.getElementById('ciimage_' + windowviewid );
... ... @@ -1032,10 +1040,7 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout
1032 1040 if (!$rootScope.isCallFromOtherModule) {
1033 1041 $("#ciimage_"+windowviewid).css("left", (screen.width-this.width-70)/2 + "px");
1034 1042 }
1035   - $("#ciimage_"+windowviewid).css("visibility","visible");
1036   - // $("#ciimage_"+windowviewid).css("width", this.width + "px");
1037   - // $("#ciimage_"+windowviewid).css("height", this.height + "px");
1038   -
  1043 + $("#ciimage_"+windowviewid).css("visibility","visible");
1039 1044 var canvasZIndex = $("#canvasCI_" + windowviewid).css("z-index");
1040 1045 var canvasPaintZIndex = $("#canvasPaintCI_" + windowviewid).css("z-index");
1041 1046  
... ... @@ -1142,20 +1147,21 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout
1142 1147 //reset option list manager and annotation
1143 1148 //call when module loaded
1144 1149 $rootScope.resetMenuOption();
  1150 + //remove pre event
  1151 + $("#ciImagePanel_" + windowviewid).off("click touchstart");
  1152 +
  1153 + $("#ciImagePanel_" + windowviewid).on('click touchstart', function (event) {
  1154 + //after drawing annotation click not work on iPad/Android device
  1155 + var pnlName = event.currentTarget.id;
  1156 + $rootScope.resetMenuOptionOnClick(pnlName);
  1157 + // store image for export while click on panel
  1158 + var currentViewTitle = $scope.GetCIwindowStoreData(windowviewid, 'currentViewTitle');
  1159 + var imageName = $scope.GetCIwindowStoreData(windowviewid, 'imageName');
  1160 + $rootScope.StoreTitleName(currentViewTitle);
  1161 + $rootScope.StoreOrgImageName(imageName);
  1162 +
  1163 + });
1145 1164  
1146   - // call from while open module in CB
1147   - $("#ciImagePanel_" + windowviewid).on('click', function (event) {
1148   -
1149   - var pnlName = event.currentTarget.id;
1150   - $rootScope.resetMenuOptionOnClick(pnlName);
1151   -
1152   - // store image for export while click on panel
1153   -
1154   - var currentViewTitle = $scope.GetCIwindowStoreData(windowviewid, 'currentViewTitle');
1155   - var imageName = $scope.GetCIwindowStoreData(windowviewid, 'imageName');
1156   - $rootScope.StoreTitleName(currentViewTitle);
1157   - $rootScope.StoreOrgImageName(imageName);
1158   - });
1159 1165 }
1160 1166  
1161 1167 $scope.GetTextVisiblity = function (windowviewid, btnTextValue) {
... ...
400-SOURCECODE/AIAHTML5.Web/app/controllers/CurrBuildController.js
... ... @@ -29,10 +29,17 @@ function ($scope, $rootScope, pages, log, Modules, $http, $compile, $location, $
29 29 }
30 30  
31 31 angular.element(document).ready(function (e) {
32   -
33   - $("#treecontent").css('height',screen.height-250);
34   - $("#cbdivarea").css('height',screen.height-170);
35   -
  32 +
  33 + var $ua = navigator.userAgent;
  34 + if (($ua.match(/(iPod|iPhone|iPad|android)/i))) {
  35 + $("#treecontent").css('height',screen.height-140);
  36 + $("#cbdivarea").css('height',screen.height-60);
  37 + }
  38 + else
  39 + {
  40 + $("#treecontent").css('height',screen.height-250);
  41 + $("#cbdivarea").css('height',screen.height-170);
  42 + }
36 43  
37 44 $('#sidebar-wrapper').unbind('click');
38 45 $("#sidebar-wrapper").on('click', function (event) {
... ...
400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js
... ... @@ -1135,6 +1135,7 @@ AIA.controller(&quot;DAController&quot;, [&quot;$scope&quot;, &quot;$rootScope&quot;, &quot;$compile&quot;, &quot;$http&quot;, &quot;$l
1135 1135 }
1136 1136  
1137 1137 $scope.daViewLoader = function (windowviewid) {
  1138 + $scope.CanvasDivScroll(windowviewid);
1138 1139 $scope.PanelActivity(windowviewid);
1139 1140 $scope.JsPanelclick(windowviewid);
1140 1141  
... ... @@ -1229,18 +1230,49 @@ AIA.controller(&quot;DAController&quot;, [&quot;$scope&quot;, &quot;$rootScope&quot;, &quot;$compile&quot;, &quot;$http&quot;, &quot;$l
1229 1230 //reset option list manager and annotation
1230 1231 //call when module loaded
1231 1232 $rootScope.resetMenuOption();
1232   - $("#daImagePanel_" + windowviewid).on('click', function (event) {
1233 1233  
  1234 + //remove pre event
  1235 + $("#daImagePanel_" + windowviewid).off("click touchstart");
  1236 +
  1237 + $("#daImagePanel_" + windowviewid).on('click touchstart', function (event) {
  1238 +
  1239 + //after drawing annotation click not work on iPad/Android device
1234 1240 var pnlName=event.currentTarget.id;
1235 1241 $rootScope.resetMenuOptionOnClick(pnlName);
1236   -
  1242 +
1237 1243 // store image for export while click on panel
1238 1244  
1239 1245 var currentViewTitle = $scope.GetwindowStoreData(windowviewid, 'currentViewTitle');
1240 1246  
1241 1247 $rootScope.StoreTitleName(currentViewTitle);
1242 1248 $scope.LoadImageToExport(windowviewid);
  1249 +
  1250 + });
  1251 +
  1252 + }
  1253 +
  1254 + $scope.CanvasDivScroll = function (windowviewid) {
  1255 + // #7972 Mozilla Firefox> Incorrect navigation
  1256 + $("#canvasDivDA_"+windowviewid).scroll(function (event) {
  1257 + var len= (event.currentTarget.id).split("_").length;
  1258 + var windowviewid = (event.currentTarget.id).split("_")[len-1];
  1259 +
  1260 + var candivScrollleft=$('#canvasDivDA_' + windowviewid).scrollLeft();
  1261 + var candivScrollTop=$('#canvasDivDA_' + windowviewid).scrollTop();
  1262 +
  1263 + // Fix Navigator position by CanvasDiv Scrolling
  1264 + var can = $("#canvasDivDA_" + windowviewid);
  1265 + var canheight = can[0].scrollHeight;
  1266 + var canwidth = can[0].scrollWidth;
  1267 +
  1268 + var dragDivTop= (candivScrollTop/canheight)*($('#navigatorDiv_' + windowviewid).height());
  1269 + var dragDivLeft= (candivScrollleft/canwidth)*($('#navigatorDiv_' + windowviewid).width());
  1270 +
  1271 + $("#draggable_" + windowviewid).css('top', dragDivTop);
  1272 + $("#draggable_" + windowviewid).css('left', dragDivLeft>40?40:dragDivLeft);
1243 1273  
  1274 + $scope.SetwindowStoreData(windowviewid,'CanvasDivLeftPosition',candivScrollleft);
  1275 + $scope.SetwindowStoreData(windowviewid,'CanvasDivTopPosition',candivScrollTop);
1244 1276 });
1245 1277 }
1246 1278  
... ... @@ -1340,17 +1372,7 @@ AIA.controller(&quot;DAController&quot;, [&quot;$scope&quot;, &quot;$rootScope&quot;, &quot;$compile&quot;, &quot;$http&quot;, &quot;$l
1340 1372 });
1341 1373 }
1342 1374 } ,
1343   - change: function (event, ui) {
1344   - var targetid = event.target.id;
1345   - var len= (targetid).split("_").length;
1346   - var windviewid = (targetid).split("_")[len-1];
1347   - var scope = angular.element(document.getElementById("daViewDA_" + windviewid)).scope();
1348   - scope.$apply(function () {
1349   - scope.onTransparencyChange(event, ui);
1350   - });
1351   - }
1352   - // ,
1353   - // stop: function (event, ui) {
  1375 + // change: function (event, ui) {
1354 1376 // var targetid = event.target.id;
1355 1377 // var len= (targetid).split("_").length;
1356 1378 // var windviewid = (targetid).split("_")[len-1];
... ... @@ -1359,6 +1381,16 @@ AIA.controller(&quot;DAController&quot;, [&quot;$scope&quot;, &quot;$rootScope&quot;, &quot;$compile&quot;, &quot;$http&quot;, &quot;$l
1359 1381 // scope.onTransparencyChange(event, ui);
1360 1382 // });
1361 1383 // }
  1384 + // ,
  1385 + stop: function (event, ui) {
  1386 + var targetid = event.target.id;
  1387 + var len= (targetid).split("_").length;
  1388 + var windviewid = (targetid).split("_")[len-1];
  1389 + var scope = angular.element(document.getElementById("daViewDA_" + windviewid)).scope();
  1390 + scope.$apply(function () {
  1391 + scope.onTransparencyChange(event, ui);
  1392 + });
  1393 + }
1362 1394 })
1363 1395 .slider("pips", {
1364 1396 rest: "label",
... ... @@ -2006,6 +2038,7 @@ AIA.controller(&quot;DAController&quot;, [&quot;$scope&quot;, &quot;$rootScope&quot;, &quot;$compile&quot;, &quot;$http&quot;, &quot;$l
2006 2038 {
2007 2039 "transparentTermNumber": $scope.daOpenInOtherModules.callOuts[i].transparentTermNumber,
2008 2040 "termNumber": $scope.daOpenInOtherModules.callOuts[i].termNumber,
  2041 + "istpboxTerm":$scope.daOpenInOtherModules.callOuts[i].istpboxTerm==undefined?0:$scope.daOpenInOtherModules.callOuts[i].istpboxTerm,
2009 2042 "tips_x": $scope.daOpenInOtherModules.callOuts[i].tips_x,
2010 2043 "tips_y": $scope.daOpenInOtherModules.callOuts[i].tips_y,
2011 2044 "x": $scope.daOpenInOtherModules.callOuts[i].x,
... ... @@ -2152,12 +2185,13 @@ AIA.controller(&quot;DAController&quot;, [&quot;$scope&quot;, &quot;$rootScope&quot;, &quot;$compile&quot;, &quot;$http&quot;, &quot;$l
2152 2185  
2153 2186 //history code
2154 2187  
2155   - if ($("#canvasDivDA_" + windowviewid).find("canvas[id='canvasPaint']").length == 0) {
  2188 + if ($("#canvasDivDA_" + windowviewid).find("canvas[id='canvasPaintDA']").length == 0) {
2156 2189 var canvasPaintID = "canvasPaintDA_" + windowviewid;
2157 2190 var canvasID = "canvasDA_" + windowviewid;
2158   - var ATBarHtml = $("#canvasDivDA_" + windowviewid).append('<canvas id="' + canvasPaintID + '" width="2277" height="3248" ng-click="FreeStylePaint($event)" class="canvas-annotationStyle1"></canvas><canvas id="' + canvasID + '" ng-click="onDrawingCanvasClick($event)" width="2277" height="3248" class="canvas-annotationStyle"></canvas>');
2159   - $compile(ATBarHtml)($scope);
2160   -
  2191 +
  2192 + var ATBarHtml = $("#canvasDivDA_" + windowviewid).append('<canvas id="' + canvasPaintID + '" width="2277" height="3248" class="canvas-annotationStyle1"></canvas><canvas id="' + canvasID + '" ontouchstart="onDrawingCanvasTouch(event)" ng-click="onDrawingCanvasClick($event)" width="2277" height="3248" class="canvas-annotationStyle"></canvas>');
  2193 + $compile(ATBarHtml)($scope);
  2194 +
2161 2195 }
2162 2196 var isCBAnnotationActive= $scope.GetwindowStoreData(windowviewid, 'isCBAnnotationActive');
2163 2197  
... ... @@ -2418,6 +2452,7 @@ AIA.controller(&quot;DAController&quot;, [&quot;$scope&quot;, &quot;$rootScope&quot;, &quot;$compile&quot;, &quot;$http&quot;, &quot;$l
2418 2452  
2419 2453 }
2420 2454  
  2455 +
2421 2456 function scaleRectangle(x, y, height, width, mirrorValue,windowviewid) {
2422 2457 var nzoom = $scope.GetwindowStoreData(windowviewid,'zoomInOut');
2423 2458 var existingZoon = 100;
... ... @@ -2647,298 +2682,15 @@ AIA.controller(&quot;DAController&quot;, [&quot;$scope&quot;, &quot;$rootScope&quot;, &quot;$compile&quot;, &quot;$http&quot;, &quot;$l
2647 2682 }
2648 2683  
2649 2684 FlipedImgCanvas.addEventListener('click', function (evt) {
2650   - $rootScope.UnsaveCurriculum = true;
2651   - var preTermData = [];
2652   - var len= (evt.currentTarget.id).split("_").length;
2653   - var windowviewid = (evt.currentTarget.id).split("_")[len-1];
2654   - var canvasDiv = document.getElementById('canvasDivDA_' + windowviewid);
2655   - $scope.imageVerticalScrollPosition = canvasDiv.scrollTop;
2656   - //to get correct data on multihighlight highlight
2657   - if ($scope.isLayerChange == true) {
2658   - $scope.isLayerChange = false;
2659   - }
2660   -
2661   - //birendra
2662   - // for mac os Command key use for multi selection
2663   - if (evt.ctrlKey || evt.metaKey) {
2664   - $scope.SetwindowStoreData(windowviewid,'multiAnnotationIsON',true);
2665   - }
2666   - else
2667   - {
2668   - $scope.SetwindowStoreData(windowviewid,'isListManagerSelected',false);
2669   - $('#typedTermName_' + windowviewid).val('');
2670   - $scope.SetwindowStoreData(windowviewid, 'fullTermlist', []);
2671   - $scope.SetwindowStoreData(windowviewid, 'AllTerms', []);
2672   - $scope.SetwindowStoreData(windowviewid,'previousHighlightList',[]);
2673   -
2674   - $scope.SetwindowStoreData(windowviewid, 'multiAnnotationIsON', false);
2675   - preTermData = $scope.GetwindowStoreData(windowviewid, 'CurriculumTermData');
2676   - $scope.SetwindowStoreData(windowviewid, 'CurriculumTermData', []);
2677   -
2678   - }
2679   -
2680   - //get mouse coordinate of mirror image click
2681   - var mousePos = $scope.getMousePos(evt.pageX,evt.pageY,windowviewid);
2682   -
2683   - var context = FlipedImgCanvas.getContext("2d");
2684   - var canvasId = context.canvas.getAttribute('id');
2685   -
2686   -
2687   - var mirrorCanvasX = context.canvas.offsetLeft;
2688   - var mirrorCanvasWidth = context.canvas.clientWidth;
2689   -
2690   - var maskCanvasId = (canvasId.replace('_MR', '_mci'));
2691   - var maskCanvas = document.getElementById(maskCanvasId);
2692   - var maskCanvasContext = maskCanvas.getContext("2d");
2693   -
2694   -
2695   - var canvasDiv = document.getElementById('canvasDivDA_' + windowviewid);
2696   -
2697   - //changing for mac os now
2698   - var os=$scope.getOS();
2699   - if(os=='MacOS')
2700   - {
2701   - var verticalScrollPosition = Math.round(canvasDiv.scrollTop)-2;
2702   - var horizontlScrollPosition = Math.round(canvasDiv.scrollLeft)-2;
2703   - }
2704   - else
2705   - {
2706   - var verticalScrollPosition = Math.round(canvasDiv.scrollTop)-1;
2707   - var horizontlScrollPosition = Math.round(canvasDiv.scrollLeft)-1;
2708   - }
2709   -
2710   - var distanceXOnMirrorImage = (parseInt(mirrorCanvasX) + parseInt(mirrorCanvasWidth)) - (parseInt(mousePos.x) + horizontlScrollPosition);// - 135);
2711   -
2712   - var mirrorXOnNormalImage = parseInt(maskCanvasContext.canvas.offsetLeft) + parseInt(distanceXOnMirrorImage);
2713   -
2714   - var actulalX = mirrorXOnNormalImage
2715   - var actualY = mousePos.y + verticalScrollPosition
2716   -
2717   -
2718   - var pixelData = maskCanvasContext.getImageData(Math.round(actulalX - parseInt(maskCanvasContext.canvas.offsetLeft)), Math.round(actualY - y), 1, 1);
2719   -
2720   - pixelData.data[0] = pixelData.data[0] - 9;
2721   - pixelData.data[1] = pixelData.data[1] - 9;
2722   - pixelData.data[2] = pixelData.data[2] - 9
2723   -
2724   - var Red;
2725   - var Green;
2726   - var Blue;
2727   - var zero = "0";
2728   -
2729   - if ((pixelData.data[0]).toString().length != 2) {
2730   - Red = zero.concat((pixelData.data[0]).toString())
2731   - }
2732   - else {
2733   - Red = (pixelData.data[0]).toString()
2734   - }
2735   - if ((pixelData.data[1]).toString().length != 2) {
2736   - Green = zero.concat((pixelData.data[1]).toString())
2737   - }
2738   - else {
2739   - Green = (pixelData.data[1]).toString()
2740   -
2741   - }
2742   - if ((pixelData.data[2]).toString().length != 2) {
2743   - Blue = zero.concat((pixelData.data[2]).toString())
2744   - }
2745   - else {
2746   - Blue = (pixelData.data[2]).toString()
2747   -
2748   - }
2749   - var RGBColor = (Red + Green + Blue);
2750   -
2751   - var previousHighlightList=$scope.GetwindowStoreData(windowviewid,'previousHighlightList');
2752   -
2753   - previousHighlightList.push(RGBColor);
2754   -
2755   - //Save Term Number to Showing Annotaion Text for CB Module
2756   - var AllTerms = $scope.GetwindowStoreData(windowviewid, 'AllTerms');
2757   - AllTerms.push({ '_TermNumber': RGBColor });
2758   - var fullTermlist = $scope.GetwindowStoreData(windowviewid, 'fullTermlist');
2759   - fullTermlist.push(parseInt(RGBColor));
2760   - var CurriculumTermData = $scope.GetwindowStoreData(windowviewid, 'CurriculumTermData');
2761   - CurriculumTermData.push({
2762   - "transparentTermNumber": 0,
2763   - "termNumber": parseInt(RGBColor),
2764   - "tips_x": parseInt( evt.pageX + horizontlScrollPosition - $('#canvasDivDA_' + windowviewid).offset().left) + 30,
2765   - "tips_y": parseInt( evt.pageY + verticalScrollPosition - $('#canvasDivDA_' + windowviewid).offset().top) + 10,
2766   - "x": evt.pageX + horizontlScrollPosition - $('#canvasDivDA_' + windowviewid).offset().left,
2767   - "y": evt.pageY + verticalScrollPosition - $('#canvasDivDA_' + windowviewid).offset().top
2768   - });
2769   -
2770   -
2771   - if ($scope.GetwindowStoreData(windowviewid,'isHighLight')) {
2772   -
2773   - if ($scope.machedIcolorInBodyRegion != null || $scope.machedIcolorInBodyRegion != undefined) {
2774   - if ($scope.machedIcolorInBodyRegion.length > 0) {
2775   - if ($scope.GetwindowStoreData(windowviewid,'multiAnnotationIsON') == false) {
2776   - for (var i = 0; i < $scope.machedIcolorInBodyRegion.length; i++) {
2777   - var bodyRegionId = $scope.machedIcolorInBodyRegion[i];
2778   -
2779   - var grayCanvasID = 'imageCanvas' + bodyRegionId + "_" + windowviewid;
2780   - var grayCanvas = document.getElementById(grayCanvasID);
2781   -
2782   - var grayCanvasContext = grayCanvas.getContext("2d");
2783   - var grayImageDataList=$scope.GetwindowStoreData(windowviewid,'grayImageDataList');
2784   - if (grayImageDataList[bodyRegionId - 1] != null || grayImageDataList[bodyRegionId - 1] != undefined) {
2785   - var grayImageData = grayImageDataList[bodyRegionId - 1];
2786   - grayCanvasContext.putImageData(grayImageData, 0, 0);
2787   - }
2788   -
2789   - // for mirrored canvas
2790   - var bodyVid=$scope.GetwindowStoreData(windowviewid,'voId');
2791   - if (bodyVid == "1" || bodyVid == "4" || bodyVid == "5" || bodyVid == "8") {
2792   - if (bodyRegionId == 4 || bodyRegionId == 5 || bodyRegionId == 6) {
2793   - var grayCanvasID = 'imageCanvas' + bodyRegionId + '_MR' + "_" + windowviewid;
2794   - var grayCanvasMR = document.getElementById(grayCanvasID);
2795   -
2796   - var grayCanvasContextMR = grayCanvasMR.getContext("2d");
2797   - var grayImageMRDataList=$scope.GetwindowStoreData(windowviewid,'grayImageMRDataList');
2798   - if (grayImageMRDataList[bodyRegionId] != null || grayImageMRDataList[bodyRegionId] != undefined) {
2799   - var grayImageDataMR = grayImageMRDataList[bodyRegionId];
2800   -
2801   - grayCanvasContextMR.putImageData(grayImageDataMR, 0, 0);
2802   - }
2803   - }
2804   - }
2805   - }
2806   - }
2807   - }
2808   - }
2809   -
2810   - $scope.highLightBodyBasedOnIcolor(RGBColor,windowviewid);
2811   - }
2812   -
2813   -
2814   - //extarct clicked body part is extarct button is already enabled.
2815   -
2816   - if ($scope.GetwindowStoreData(windowviewid,'isExtract') == true) {
2817   - if ($scope.GetwindowStoreData(windowviewid,'multiAnnotationIsON') == false) {
2818   - $scope.SetwindowStoreData(windowviewid,'isListManagerSelected',false);
2819   - }
2820   - $scope.enableExtract(false,windowviewid);
2821   - }
2822   -
2823   - var annotationText
2824   - var TermNData=$scope.GetwindowStoreData(windowviewid,'TermNumberData');
2825   - if (TermNData != null && TermNData != undefined) {
2826   -
2827   - annotationText = $scope.GetAnnotationText(parseInt(RGBColor),windowviewid);
2828   - }
2829   - else {
2830   - $rootScope.daloadSearchData(windowviewid);
2831   - annotationText = $scope.GetAnnotationText(parseInt(RGBColor),windowviewid);
2832   - }
2833   - var TermAnnotationText=$scope.GetwindowStoreData(windowviewid,'TermAnnotationText');
2834   -
2835   - if ($scope.GetwindowStoreData(windowviewid,'multiAnnotationIsON') == true) {
2836   -
2837   -
2838   - $scope.MultiLanguageAnnationArray = [];
2839   -
2840   - if (TermAnnotationText.length>0) {
2841   - for (var i = 0; i <= TermAnnotationText.length - 1; i++) {
2842   -
2843   - $scope.MultiLanguageAnnationArray.push(TermAnnotationText[i]);
2844   - }
2845   -
2846   - $scope.createDynamicSpeechBubble(evt, evt.pageX + horizontlScrollPosition - $('#canvasDivDA_' + windowviewid).offset().left, evt.pageY + verticalScrollPosition - $('#canvasDivDA_' + windowviewid).offset().top, true, 0, 0, windowviewid, RGBColor);
2847   - }
2848   - }
2849   - else {
2850   -
2851   - //Remove Previous TermNumber from TBox
2852   - $('#bord_annotation_' + windowviewid).css({ "width": "0px", "display": "none" });
2853   - $('.dynCross_anno_' + windowviewid).parent().parent().parent().remove();
2854   - if ($('#sppeachBubble_annotation_' + windowviewid).length > 0) {
2855   - $('#sppeachBubble_annotation_' + windowviewid).remove();
2856   - }
2857   - if ($('#bord_annotation_' + windowviewid).length > 0) {
2858   - $('#bord_annotation_' + windowviewid).remove();
2859   - }
2860   - if ($('#dot_annotation_' + windowviewid).length > 0) {
2861   - $('#dot_annotation_' + windowviewid).remove();
2862   - }
2863   - if (preTermData != undefined && preTermData.length > 0) {
2864   - for (var i = 0; i < preTermData.length; i++) {
2865   - if (preTermData[i].termNumber != parseInt(RGBColor)) {
2866   - if ($('#sppeachBubble_' + windowviewid + '-' + preTermData[i].termNumber).length > 0) {
2867   - $('#sppeachBubble_' + windowviewid + '-' + preTermData[i].termNumber).remove();
2868   - }
2869   - if ($('#sppeachBubble_annotation_' + windowviewid + '-' + preTermData[i].transparentTermNumber).length > 0) {
2870   - $('#sppeachBubble_annotation_' + windowviewid + '-' + preTermData[i].transparentTermNumber).remove();
2871   - }
2872   - }
2873   -
2874   - }
2875   - }
2876   -
2877   - if ($('#dot_' + windowviewid).length > 0) {
2878   - $('#dot_' + windowviewid).remove();
2879   -
2880   -
2881   - if ($('#sppeachBubble_' + windowviewid).length > 0) {
2882   - $('#sppeachBubble_' + windowviewid).remove();
2883   - }
2884   -
2885   - if ($('.com_' + windowviewid).length > 0) {
2886   - $('.com_' + windowviewid).remove();
2887   - }
2888   - if ($('#bord_' + windowviewid).length > 0) {
2889   - $('#bord_' + windowviewid).remove();
2890   - }
2891   -
2892   - //Remove previous SpeechBubble with termnumber
2893   - if (preTermData != undefined && preTermData.length > 0) {
2894   - for (var i = 0; i < preTermData.length; i++) {
2895   - if (preTermData[i].termNumber != parseInt(RGBColor)) {
2896   - if ($('#sppeachBubble_' + windowviewid + '-' + preTermData[i].termNumber).length > 0) {
2897   - $('#sppeachBubble_' + windowviewid + '-' + preTermData[i].termNumber).remove();
2898   - }
2899   - }
2900   - if ($('#sppeachBubble_annotation_' + windowviewid + '-' + preTermData[i].transparentTermNumber).length > 0) {
2901   - $('#sppeachBubble_annotation_' + windowviewid + '-' + preTermData[i].transparentTermNumber).remove();
2902   - }
2903   - }
2904   - }
2905   -
2906   - $scope.MultiLanguageAnnationArray = [];
2907   - if (TermAnnotationText.length > 0) {
2908   - for (var i = 0; i <= TermAnnotationText.length - 1; i++) {
2909   -
2910   - $scope.MultiLanguageAnnationArray.push(TermAnnotationText[i]);
2911   - }
2912   -
2913   - $scope.createDynamicSpeechBubble(evt, evt.pageX + horizontlScrollPosition - $('#canvasDivDA_' + windowviewid).offset().left, evt.pageY + verticalScrollPosition - $('#canvasDivDA_' + windowviewid).offset().top, true, 0, 0, windowviewid, RGBColor);
2914   - }
2915   - }
2916   - else {
2917   -
2918   - $scope.MultiLanguageAnnationArray = [];
2919   -
2920   - if (TermAnnotationText.length > 0) {
2921   - for (var i = 0; i <= TermAnnotationText.length - 1; i++) {
2922   -
2923   - $scope.MultiLanguageAnnationArray.push(TermAnnotationText[i]);
2924   - }
2925   - $scope.createDynamicSpeechBubble(evt, evt.pageX + horizontlScrollPosition - $('#canvasDivDA_' + windowviewid).offset().left, evt.pageY + verticalScrollPosition - $('#canvasDivDA_' + windowviewid).offset().top, true, 0, 0, windowviewid, RGBColor);
2926   - }
2927   - }
2928   -
2929   -
2930   - }
2931   -
2932   - }, false);
2933   -
2934   - FlipedImgCanvas.addEventListener('mousedown', function (evt) {
  2685 + $scope.FlipedImgCanvasClickAnnotation(FlipedImgCanvas,x,y,evt);
2935 2686  
2936 2687 }, false);
2937 2688  
  2689 + FlipedImgCanvas.addEventListener('touchstart', function (evt) {
2938 2690  
2939   - FlipedImgCanvas.addEventListener('mouseup', function (evt) {
  2691 + $scope.FlipedImgCanvasClickAnnotation(FlipedImgCanvas,x,y,evt);
2940 2692  
2941   - }, false);
  2693 + },false);
2942 2694  
2943 2695 var context = FlipedImgCanvas.getContext("2d");
2944 2696  
... ... @@ -2947,14 +2699,9 @@ AIA.controller(&quot;DAController&quot;, [&quot;$scope&quot;, &quot;$rootScope&quot;, &quot;$compile&quot;, &quot;$http&quot;, &quot;$l
2947 2699 var cw, ch, imgW, imgH, mouseX, mouseY;
2948 2700 var scaleFactor = 1.00;
2949 2701  
2950   - //$scaler = $("#scaler");
2951   - //$scaler.val(scaleFactor);
2952   - //$scaler.hide();
2953   -
2954 2702 var img = new Image();
2955 2703 img.onload = start;
2956 2704  
2957   - // img.src = "~/../content/images/" + src;;
2958 2705 img.src = src;
2959 2706  
2960 2707  
... ... @@ -3124,333 +2871,298 @@ AIA.controller(&quot;DAController&quot;, [&quot;$scope&quot;, &quot;$rootScope&quot;, &quot;$compile&quot;, &quot;$http&quot;, &quot;$l
3124 2871  
3125 2872 }
3126 2873  
3127   - $scope.DrawImage = function (h, w, x, y, src, bodyRegionId, isMaskImage, windowviewid) {
3128   - $scope.DisableUI();
3129   -
3130   - var imgCanvas = document.createElement('canvas');
  2874 + $scope.FlipedImgCanvasClickAnnotation =function(FlipedImgCanvas,BodyRegoinX,BodyRegoinY,evt){
  2875 +
  2876 + $rootScope.UnsaveCurriculum = true;
  2877 + var len= (evt.currentTarget.id).split("_").length;
  2878 + var windowviewid = (evt.currentTarget.id).split("_")[len-1];
  2879 + var canvasDiv = document.getElementById('canvasDivDA_' + windowviewid);
  2880 + $scope.imageVerticalScrollPosition = canvasDiv.scrollTop;
  2881 + //to get correct data on multihighlight highlight
  2882 + if ($scope.isLayerChange == true) {
  2883 + $scope.isLayerChange = false;
  2884 + }
3131 2885  
3132   - imgCanvas.height = h;
3133   - imgCanvas.width = w;
3134   - imgCanvas.setAttribute("data-IsMirrored", "N")
3135   - imgCanvas.style.position = "absolute";
3136   - imgCanvas.style.left = x + "px";
3137   - imgCanvas.style.top = y + "px";
  2886 + //birendra
  2887 + // for mac os Command key use for multi selection
  2888 + if (evt.ctrlKey || evt.metaKey) {
  2889 + $scope.SetwindowStoreData(windowviewid,'multiAnnotationIsON',true);
  2890 + }
  2891 + else
  2892 + {
  2893 + $scope.SetwindowStoreData(windowviewid,'isListManagerSelected',false);
  2894 + $('#typedTermName_' + windowviewid).val('');
  2895 + $scope.SetwindowStoreData(windowviewid, 'fullTermlist', []);
  2896 + $scope.SetwindowStoreData(windowviewid, 'AllTerms', []);
  2897 + $scope.SetwindowStoreData(windowviewid,'previousHighlightList',[]);
3138 2898  
3139   - if (isMaskImage == 'Y') {
3140   - imgCanvas.style.visibility = 'hidden';
3141   - imgCanvas.id = 'imageCanvas' + bodyRegionId + '_mci' + "_" + windowviewid;
  2899 + $scope.SetwindowStoreData(windowviewid, 'multiAnnotationIsON', false);
  2900 +
3142 2901 }
3143   - else {
3144   - imgCanvas.id = 'imageCanvas' + bodyRegionId + "_" + windowviewid;
3145 2902  
3146   - if (bodyRegionId == 3) {
3147   - //set z index of hip canavs to fix the issue caused by overlapping of arm canavs on hip canavs.
3148   - imgCanvas.style.zIndex = "100";
3149   - }
3150   - if (bodyRegionId.match('modestyImg')) {
3151   - //added class to further access this canavs to show and hide leaf as per modesty seting
3152   - imgCanvas.className = 'modestyImg_'+windowviewid;
3153   - imgCanvas.style.visibility = 'hidden'
3154   - //set z index to make leaf canvas on top of hip canavs
3155   - imgCanvas.style.zIndex = "200";
  2903 + var MousePositionX=0;
  2904 + var MousePositionY=0;
  2905 + var $ua = navigator.userAgent;
  2906 + if (($ua.match(/(iPod|iPhone|iPad|android)/i))) {
  2907 + // var touch = e.originalEvent.touches[0] || e.originalEvent.changedTouches[0];
  2908 + if(evt.touches!=undefined ||evt.changedTouches!=undefined)
  2909 + {
  2910 + var touch = evt.touches[0] || evt.changedTouches[0];
  2911 + MousePositionX=touch.pageX ;
  2912 + MousePositionY=touch.pageY ;
3156 2913 }
3157   - var bodyVid=$scope.GetwindowStoreData(windowviewid,'voId');
  2914 + else return;
  2915 + }
  2916 + else
  2917 + {
  2918 + MousePositionX=evt.pageX ;
  2919 + MousePositionY=evt.pageY ;
  2920 +
  2921 + }
3158 2922  
3159   - if ((bodyVid == 11 || bodyVid == 9) && bodyRegionId == 6) {
3160   - imgCanvas.style.zIndex = "500";
3161   - }
  2923 + //get mouse coordinate of mirror image click
  2924 + var mousePos = $scope.getMousePos(MousePositionX,MousePositionY,windowviewid);
3162 2925  
3163   - if ($scope.GetwindowStoreData(windowviewid,'isExtract') == true) {
3164   - imgCanvas.style.visibility = 'visible'
3165   - }
  2926 + var context = FlipedImgCanvas.getContext("2d");
  2927 + var canvasId = context.canvas.getAttribute('id');
  2928 +
  2929 +
  2930 + var mirrorCanvasX = context.canvas.offsetLeft;
  2931 + var mirrorCanvasWidth = context.canvas.clientWidth;
  2932 +
  2933 + var maskCanvasId = (canvasId.replace('_MR', '_mci'));
  2934 + var maskCanvas = document.getElementById(maskCanvasId);
  2935 + var maskCanvasContext = maskCanvas.getContext("2d");
3166 2936  
  2937 +
  2938 + var canvasDiv = document.getElementById('canvasDivDA_' + windowviewid);
  2939 +
  2940 + //changing for mac os now
  2941 + var os=$scope.getOS();
  2942 + if(os=='MacOS')
  2943 + {
  2944 + var verticalScrollPosition = Math.round(canvasDiv.scrollTop)-2;
  2945 + var horizontlScrollPosition = Math.round(canvasDiv.scrollLeft)-2;
  2946 + }
  2947 + else
  2948 + {
  2949 + var verticalScrollPosition = Math.round(canvasDiv.scrollTop)-1;
  2950 + var horizontlScrollPosition = Math.round(canvasDiv.scrollLeft)-1;
3167 2951 }
3168 2952  
3169   - imgCanvas.addEventListener('click', function (evt) {
3170   - $rootScope.UnsaveCurriculum = true;
3171   - var preTermData; //Use for Remove SpeechBUbble With TermNumber
3172   - var len= (evt.currentTarget.id).split("_").length;
3173   - var windowviewid = (evt.currentTarget.id).split("_")[len-1];
3174   - var canvasDiv = document.getElementById('canvasDivDA_' + windowviewid);
3175   - $scope.imageVerticalScrollPosition = canvasDiv.scrollTop;
3176   - if ($scope.isLayerChange == true) {
3177   - $scope.isLayerChange = false;
3178   - }
3179   - //birendra
3180   - // for mac os Command key use for multi selection
3181   - if (evt.ctrlKey || evt.metaKey) {
3182   - $scope.SetwindowStoreData(windowviewid,'multiAnnotationIsON',true);
  2953 + var distanceXOnMirrorImage = (parseInt(mirrorCanvasX) + parseInt(mirrorCanvasWidth)) - (parseInt(mousePos.x) + horizontlScrollPosition);
3183 2954  
3184   - console.log('CTRL ON')
3185   - }
3186   - else
3187   - {
3188   - preTermData = $scope.GetwindowStoreData(windowviewid, 'CurriculumTermData');
  2955 + var mirrorXOnNormalImage = parseInt(maskCanvasContext.canvas.offsetLeft) + parseInt(distanceXOnMirrorImage);
3189 2956  
3190   - $scope.SetwindowStoreData(windowviewid,'isListManagerSelected',false);
3191   - $('#typedTermName_' + windowviewid).val('');
3192   - $scope.SetwindowStoreData(windowviewid, 'fullTermlist', []);
3193   - $scope.SetwindowStoreData(windowviewid, 'AllTerms', []);
3194   - $scope.SetwindowStoreData(windowviewid,'previousHighlightList',[]);
3195   - $scope.SetwindowStoreData(windowviewid, 'multiAnnotationIsON', false);
3196   - $scope.SetwindowStoreData(windowviewid, 'CurriculumTermData', []);
  2957 + var actulalX = mirrorXOnNormalImage
  2958 + var actualY = mousePos.y + verticalScrollPosition
3197 2959  
3198   - console.log('multiAnnotationIsON: ' + false);
3199 2960  
3200   - }
  2961 + var pixelData = maskCanvasContext.getImageData(Math.round(actulalX - parseInt(maskCanvasContext.canvas.offsetLeft)), Math.round(actualY - BodyRegoinY), 1, 1);
3201 2962  
  2963 + pixelData.data[0] = pixelData.data[0] - 9;
  2964 + pixelData.data[1] = pixelData.data[1] - 9;
  2965 + pixelData.data[2] = pixelData.data[2] - 9
3202 2966  
3203   - var annotationText;
3204   - var context = imgCanvas.getContext("2d");
  2967 + var Red;
  2968 + var Green;
  2969 + var Blue;
  2970 + var zero = "0";
3205 2971  
  2972 + if ((pixelData.data[0]).toString().length != 2) {
  2973 + Red = zero.concat((pixelData.data[0]).toString())
  2974 + }
  2975 + else {
  2976 + Red = (pixelData.data[0]).toString()
  2977 + }
  2978 + if ((pixelData.data[1]).toString().length != 2) {
  2979 + Green = zero.concat((pixelData.data[1]).toString())
  2980 + }
  2981 + else {
  2982 + Green = (pixelData.data[1]).toString()
3206 2983  
3207   - var canvasId = context.canvas.getAttribute('id');
3208   - var maskCanvasId;
3209   - //for leaf canvas
3210   - if (canvasId.match('modestyImg')) {
3211   - maskCanvasId = canvasId;
3212   - }
3213   - else {
3214   - maskCanvasId = canvasId.split("_")[0] + '_mci' + "_" + windowviewid;
3215   - }
3216   - var maskCanvas = document.getElementById(maskCanvasId);
3217   - var maskCanvasContext = maskCanvas.getContext("2d");
  2984 + }
  2985 + if ((pixelData.data[2]).toString().length != 2) {
  2986 + Blue = zero.concat((pixelData.data[2]).toString())
  2987 + }
  2988 + else {
  2989 + Blue = (pixelData.data[2]).toString()
3218 2990  
3219   - var mousePos = $scope.getMousePos(evt.pageX,evt.pageY,windowviewid);
  2991 + }
  2992 + var RGBColor = (Red + Green + Blue);
3220 2993  
3221   - var canvasDiv = document.getElementById('canvasDivDA_' + windowviewid);
3222   - //changing for mac os now
3223   - var os=$scope.getOS();
3224   - if(os=='MacOS')
3225   - {
3226   - var verticalScrollPosition = Math.round(canvasDiv.scrollTop)-2;
3227   - var horizontlScrollPosition = Math.round(canvasDiv.scrollLeft)-2;
3228   - }
3229   - else
3230   - {
3231   - var verticalScrollPosition = Math.round(canvasDiv.scrollTop)-1;
3232   - var horizontlScrollPosition = Math.round(canvasDiv.scrollLeft)-1;
3233   - }
3234   -
3235   - //We substracted 135, as the difference between flex and html coordinates for same organ is 135
3236   -
3237   - var actulalX = mousePos.x + horizontlScrollPosition;
3238   - var actualY = mousePos.y + verticalScrollPosition;
  2994 + var previousHighlightList=$scope.GetwindowStoreData(windowviewid,'previousHighlightList');
  2995 +
  2996 + previousHighlightList.push(RGBColor);
  2997 +
  2998 + //Save Term Number to Showing Annotaion Text for CB Module
  2999 + var AllTerms = $scope.GetwindowStoreData(windowviewid, 'AllTerms');
  3000 + AllTerms.push({ '_TermNumber': RGBColor });
  3001 + var fullTermlist = $scope.GetwindowStoreData(windowviewid, 'fullTermlist');
  3002 + fullTermlist.push(parseInt(RGBColor));
  3003 +
  3004 + if ($scope.GetwindowStoreData(windowviewid,'isHighLight')) {
3239 3005  
3240   - var RGBColor = $scope.GetRGBColor(maskCanvasContext, actulalX, actualY, x, y);
  3006 + if ($scope.machedIcolorInBodyRegion != null || $scope.machedIcolorInBodyRegion != undefined) {
  3007 + if ($scope.machedIcolorInBodyRegion.length > 0) {
  3008 + if ($scope.GetwindowStoreData(windowviewid,'multiAnnotationIsON') == false) {
  3009 + for (var i = 0; i < $scope.machedIcolorInBodyRegion.length; i++) {
  3010 + var bodyRegionId = $scope.machedIcolorInBodyRegion[i];
3241 3011  
  3012 + var grayCanvasID = 'imageCanvas' + bodyRegionId + "_" + windowviewid;
  3013 + var grayCanvas = document.getElementById(grayCanvasID);
3242 3014  
3243   - //Modesty ON
3244   - if (maskCanvasId.match('modestyImg') && RGBColor != '000000') {
3245   - RGBColor = DA[0].figLeafTermId;
3246   - annotationText = $scope.GetAnnotationBasedOnActualTermNo(RGBColor, null, windowviewid);
3247   - }
3248   - //Modesty On but clicked somewhre else, we did modesty check because the modesty image covers whole body region so if user will click to
3249   - //see the annotation apart from leaf then the actual click will be on modesty canvas, but for annotation er
3250   - //
3251   - else if (maskCanvasId.match('modestyImg') && RGBColor == '000000') {
  3015 + var grayCanvasContext = grayCanvas.getContext("2d");
  3016 + var grayImageDataList=$scope.GetwindowStoreData(windowviewid,'grayImageDataList');
  3017 + if (grayImageDataList[bodyRegionId - 1] != null || grayImageDataList[bodyRegionId - 1] != undefined) {
  3018 + var grayImageData = grayImageDataList[bodyRegionId - 1];
  3019 + grayCanvasContext.putImageData(grayImageData, 0, 0);
  3020 + }
3252 3021  
3253   - bodyRegionId = maskCanvasId.split("_")[0].slice(-1);
3254   - maskCanvasId = 'imageCanvas' + bodyRegionId + '_mci' + "_" + windowviewid;
  3022 + // for mirrored canvas
  3023 + var bodyVid=$scope.GetwindowStoreData(windowviewid,'voId');
  3024 + if (bodyVid == "1" || bodyVid == "4" || bodyVid == "5" || bodyVid == "8") {
  3025 + if (bodyRegionId == 4 || bodyRegionId == 5 || bodyRegionId == 6) {
  3026 + var grayCanvasID = 'imageCanvas' + bodyRegionId + '_MR' + "_" + windowviewid;
  3027 + var grayCanvasMR = document.getElementById(grayCanvasID);
3255 3028  
3256   - var maskCanvas = document.getElementById(maskCanvasId);
3257   - var maskCanvasContext = maskCanvas.getContext("2d");
3258   - RGBColor = $scope.GetRGBColor(maskCanvasContext, actulalX, actualY, x, y);
  3029 + var grayCanvasContextMR = grayCanvasMR.getContext("2d");
  3030 + var grayImageMRDataList=$scope.GetwindowStoreData(windowviewid,'grayImageMRDataList');
  3031 + if (grayImageMRDataList[bodyRegionId] != null || grayImageMRDataList[bodyRegionId] != undefined) {
  3032 + var grayImageDataMR = grayImageMRDataList[bodyRegionId];
3259 3033  
  3034 + grayCanvasContextMR.putImageData(grayImageDataMR, 0, 0);
  3035 + }
  3036 + }
  3037 + }
  3038 + }
  3039 + }
  3040 + }
3260 3041 }
3261   - else {
3262   - RGBColor = $scope.GetRGBColor(maskCanvasContext, actulalX, actualY, x, y);
3263 3042  
3264   - }
3265   - var TermNData=$scope.GetwindowStoreData(windowviewid,'TermNumberData');
3266   - if (TermNData != null && TermNData != undefined) {
3267   - annotationText = $scope.GetAnnotationText(parseInt(RGBColor),windowviewid);
  3043 + $scope.highLightBodyBasedOnIcolor(RGBColor,windowviewid);
  3044 + }
3268 3045  
3269   - }
3270   - else {
3271   - $rootScope.daloadSearchData(windowviewid);
3272   - annotationText = $scope.GetAnnotationText(parseInt(RGBColor),windowviewid);
3273 3046  
  3047 + //extarct clicked body part is extarct button is already enabled.
  3048 +
  3049 + if ($scope.GetwindowStoreData(windowviewid,'isExtract') == true) {
  3050 + if ($scope.GetwindowStoreData(windowviewid,'multiAnnotationIsON') == false) {
  3051 + $scope.SetwindowStoreData(windowviewid,'isListManagerSelected',false);
3274 3052 }
3275   - var previousHighlightList=$scope.GetwindowStoreData(windowviewid,'previousHighlightList');
  3053 + $scope.enableExtract(false,windowviewid);
  3054 + }
3276 3055  
3277   - previousHighlightList.push(RGBColor);
3278   -
3279   - //Save Term Number to Showing Annotaion for CB Module
3280   - var AllTerms = $scope.GetwindowStoreData(windowviewid, 'AllTerms');
3281   - AllTerms.push({ '_TermNumber': RGBColor });
3282   - var fullTermlist = $scope.GetwindowStoreData(windowviewid, 'fullTermlist');
3283   - fullTermlist.push(parseInt(RGBColor));
3284   -
3285   - var CurriculumTermData = $scope.GetwindowStoreData(windowviewid, 'CurriculumTermData');
3286   - CurriculumTermData.push({
3287   - "transparentTermNumber": 0,
3288   - "termNumber": parseInt(RGBColor),
3289   - "tips_x": parseInt( evt.pageX + horizontlScrollPosition - $('#canvasDivDA_' + windowviewid).offset().left) + 30,
3290   - "tips_y": parseInt( evt.pageY + verticalScrollPosition - $('#canvasDivDA_' + windowviewid).offset().top) + 10,
3291   - "x": evt.pageX + horizontlScrollPosition - $('#canvasDivDA_' + windowviewid).offset().left,
3292   - "y": evt.pageY + verticalScrollPosition - $('#canvasDivDA_' + windowviewid).offset().top
3293   - });
  3056 + var annotationText
  3057 + var TermNData=$scope.GetwindowStoreData(windowviewid,'TermNumberData');
  3058 + if (TermNData != null && TermNData != undefined) {
3294 3059  
3295   -
  3060 + annotationText = $scope.GetAnnotationText(parseInt(RGBColor),windowviewid);
  3061 + }
  3062 + else
  3063 + {
  3064 + $rootScope.daloadSearchData(windowviewid);
  3065 + annotationText = $scope.GetAnnotationText(parseInt(RGBColor),windowviewid);
  3066 + }
  3067 + var TermAnnotationText=$scope.GetwindowStoreData(windowviewid,'TermAnnotationText');
3296 3068  
3297   - if ($scope.GetwindowStoreData(windowviewid,'isHighLight') == true) {
3298   - if ($scope.machedIcolorInBodyRegion != null || $scope.machedIcolorInBodyRegion != undefined) {
3299   - if ($scope.machedIcolorInBodyRegion.length > 0) {
3300   - if ($scope.GetwindowStoreData(windowviewid,'multiAnnotationIsON') == false) {
3301   - for (var i = 0; i < $scope.machedIcolorInBodyRegion.length; i++) {
3302   - var bodyRegionId = $scope.machedIcolorInBodyRegion[i];
3303   -
3304   - var grayCanvasID = 'imageCanvas' + bodyRegionId + "_" + windowviewid;
3305   - var grayCanvas = document.getElementById(grayCanvasID);
3306   - var grayImageDataList=$scope.GetwindowStoreData(windowviewid,'grayImageDataList');
3307   - var grayCanvasContext = grayCanvas.getContext("2d");
3308   - if (grayImageDataList[bodyRegionId - 1] != null || grayImageDataList[bodyRegionId - 1] != undefined) {
3309   - var grayImageData = grayImageDataList[bodyRegionId - 1];
3310   - grayCanvasContext.putImageData(grayImageData, 0, 0);
3311   - }
3312   - var bodyVid=$scope.GetwindowStoreData(windowviewid,'voId');
3313   - // for unhighlight the mirrored body region
3314   - if (bodyVid == "1" || bodyVid == "4" || bodyVid == "5" || bodyVid == "8") {
3315   - if (bodyRegionId == 4 || bodyRegionId == 5 || bodyRegionId == 6) {
3316   - var grayCanvasID = 'imageCanvas' + bodyRegionId + '_MR' + "_" + windowviewid;
3317   - var grayCanvasMR = document.getElementById(grayCanvasID);
3318   - var grayImageMRDataList=$scope.GetwindowStoreData(windowviewid,'grayImageMRDataList');
3319   - var grayCanvasContextMR = grayCanvasMR.getContext("2d");
  3069 + if ($scope.GetwindowStoreData(windowviewid,'multiAnnotationIsON') == true) {
3320 3070  
3321   - if (grayImageMRDataList[bodyRegionId] != null || grayImageMRDataList[bodyRegionId] != undefined) {
  3071 + $scope.MultiLanguageAnnationArray = [];
3322 3072  
3323   - var grayImageDataMR = grayImageMRDataList[bodyRegionId];
  3073 + if (TermAnnotationText.length>0) {
  3074 + for (var i = 0; i <= TermAnnotationText.length - 1; i++) {
3324 3075  
3325   - grayCanvasContextMR.putImageData(grayImageDataMR, 0, 0);
  3076 + $scope.MultiLanguageAnnationArray.push(TermAnnotationText[i]);
  3077 + }
3326 3078  
3327   - }
3328   - }
3329   - }
  3079 + $scope.createDynamicSpeechBubble(evt, MousePositionX + horizontlScrollPosition - $('#canvasDivDA_' + windowviewid).offset().left, MousePositionY + verticalScrollPosition - $('#canvasDivDA_' + windowviewid).offset().top, true, 0, 0, windowviewid, RGBColor);
  3080 + }
  3081 + }
  3082 + else
  3083 + {
  3084 + $scope.saveTermNumberForSaveCB(windowviewid,RGBColor);
3330 3085  
3331   - }
3332   - }
3333   - }
3334   - }
  3086 + $scope.MultiLanguageAnnationArray = [];
  3087 + if (TermAnnotationText.length > 0) {
  3088 +
  3089 + for (var i = 0; i <= TermAnnotationText.length - 1; i++) {
3335 3090  
3336   - if (maskCanvasId.match('modestyImg') && RGBColor != '000000') { }
3337   - else
3338   - {
3339   - $scope.highLightBodyBasedOnIcolor(RGBColor,windowviewid);
  3091 + $scope.MultiLanguageAnnationArray.push(TermAnnotationText[i]);
3340 3092 }
3341 3093  
  3094 + $scope.createDynamicSpeechBubble(evt, MousePositionX + horizontlScrollPosition - $('#canvasDivDA_' + windowviewid).offset().left, MousePositionY + verticalScrollPosition - $('#canvasDivDA_' + windowviewid).offset().top, true, 0, 0, windowviewid, RGBColor);
  3095 + }
  3096 +
  3097 + }
  3098 +
  3099 + var CurriculumTermData = $scope.GetwindowStoreData(windowviewid, 'CurriculumTermData');
  3100 + CurriculumTermData.push({
  3101 + "transparentTermNumber": 0,
  3102 + "termNumber": parseInt(RGBColor),
  3103 + "istpboxTerm":0,
  3104 + "tips_x": parseInt( MousePositionX + horizontlScrollPosition - $('#canvasDivDA_' + windowviewid).offset().left) + 30,
  3105 + "tips_y": parseInt( MousePositionY + verticalScrollPosition - $('#canvasDivDA_' + windowviewid).offset().top) + 10,
  3106 + "x": MousePositionX + horizontlScrollPosition - $('#canvasDivDA_' + windowviewid).offset().left,
  3107 + "y": MousePositionY + verticalScrollPosition - $('#canvasDivDA_' + windowviewid).offset().top
  3108 + });
  3109 +
  3110 +
  3111 + }
  3112 +
  3113 + $scope.DrawImage = function (h, w, x, y, src, bodyRegionId, isMaskImage, windowviewid) {
  3114 + $scope.DisableUI();
  3115 +
  3116 + var imgCanvas = document.createElement('canvas');
  3117 +
  3118 + imgCanvas.height = h;
  3119 + imgCanvas.width = w;
  3120 + imgCanvas.setAttribute("data-IsMirrored", "N")
  3121 + imgCanvas.style.position = "absolute";
  3122 + imgCanvas.style.left = x + "px";
  3123 + imgCanvas.style.top = y + "px";
  3124 +
  3125 + if (isMaskImage == 'Y') {
  3126 + imgCanvas.style.visibility = 'hidden';
  3127 + imgCanvas.id = 'imageCanvas' + bodyRegionId + '_mci' + "_" + windowviewid;
  3128 + }
  3129 + else {
  3130 + imgCanvas.id = 'imageCanvas' + bodyRegionId + "_" + windowviewid;
  3131 +
  3132 + if (bodyRegionId == 3) {
  3133 + //set z index of hip canavs to fix the issue caused by overlapping of arm canavs on hip canavs.
  3134 + imgCanvas.style.zIndex = "100";
  3135 + }
  3136 + if (bodyRegionId.match('modestyImg')) {
  3137 + //added class to further access this canavs to show and hide leaf as per modesty seting
  3138 + imgCanvas.className = 'modestyImg_'+windowviewid;
  3139 + imgCanvas.style.visibility = 'hidden'
  3140 + //set z index to make leaf canvas on top of hip canavs
  3141 + imgCanvas.style.zIndex = "200";
3342 3142 }
  3143 + var bodyVid=$scope.GetwindowStoreData(windowviewid,'voId');
3343 3144  
3344   -
3345   - //extarct clisked body part is extarct button is already enabled.
3346   - if ($scope.GetwindowStoreData(windowviewid,'isExtract') == true) {
3347   - if ($scope.GetwindowStoreData(windowviewid,'multiAnnotationIsON') == false) {
3348   - $scope.SetwindowStoreData(windowviewid,'isListManagerSelected',false);
3349   - }
3350   - $scope.enableExtract(false,windowviewid);
  3145 + if ((bodyVid == 11 || bodyVid == 9) && bodyRegionId == 6) {
  3146 + imgCanvas.style.zIndex = "500";
3351 3147 }
3352 3148  
3353   - var TermAnnotationText=$scope.GetwindowStoreData(windowviewid,'TermAnnotationText');
3354   - if ($scope.GetwindowStoreData(windowviewid,'multiAnnotationIsON') == true) {
3355   -
3356   - if (TermAnnotationText.length > 0) {
3357   - $scope.MultiLanguageAnnationArray = [];
3358   - for (var i = 0; i <= TermAnnotationText.length - 1; i++) {
3359   -
3360   - $scope.MultiLanguageAnnationArray.push(TermAnnotationText[i]);
3361   - }
3362   -
3363   - $scope.createDynamicSpeechBubble(evt, evt.pageX + horizontlScrollPosition - $('#canvasDivDA_' + windowviewid).offset().left, evt.pageY + verticalScrollPosition - $('#canvasDivDA_' + windowviewid).offset().top, true, 0, 0, windowviewid, RGBColor);
3364   - }
3365   -
  3149 + if ($scope.GetwindowStoreData(windowviewid,'isExtract') == true) {
  3150 + imgCanvas.style.visibility = 'visible'
3366 3151 }
3367   - else {
3368   -
3369   - $scope.MultiLanguageAnnationArray = [];
3370   -
3371   - console.log('1. annotationText: ' + annotationText);
3372   -
3373   - $('#bord_annotation_' + windowviewid).css({ "width": "0px", "display": "none" });
3374   - $('.dynCross_anno_' + windowviewid).parent().parent().parent().remove();
3375   - if ($('#sppeachBubble_annotation_' + windowviewid).length > 0) {
3376   - $('#sppeachBubble_annotation_' + windowviewid).remove();
3377   - }
3378   - if ($('#bord_annotation_' + windowviewid).length > 0) {
3379   - $('#bord_annotation_' + windowviewid).remove();
3380   - }
3381   - if ($('#dot_annotation_' + windowviewid).length > 0) {
3382   - $('#dot_annotation_' + windowviewid).remove();
3383   - }
3384   - if (preTermData != undefined && preTermData.length > 0) {
3385   - for (var i = 0; i < preTermData.length; i++) {
3386   - if (preTermData[i].termNumber != parseInt(RGBColor)) {
3387   - if ($('#sppeachBubble_' + windowviewid + '-' + preTermData[i].termNumber).length > 0) {
3388   - $('#sppeachBubble_' + windowviewid + '-' + preTermData[i].termNumber).remove();
3389   - }
3390   - }
3391   - if ($('#sppeachBubble_annotation_' + windowviewid + '-' + preTermData[i].transparentTermNumber).length > 0) {
3392   - $('#sppeachBubble_annotation_' + windowviewid + '-' + preTermData[i].transparentTermNumber).remove();
3393   - }
3394   - }
3395   - }
3396   -
3397   - if ($('#dot_'+windowviewid).length > 0) {
3398   - $('#dot_'+windowviewid).remove();
3399   -
3400   - if ($('#sppeachBubble_'+windowviewid).length > 0) {
3401   - $('#sppeachBubble_' + windowviewid).remove();
3402   - }
3403   - if ($('.com_'+windowviewid).length > 0) {
3404   - $('.com_'+windowviewid).remove();
3405   - }
3406   - if ($('#bord_'+windowviewid).length > 0) {
3407   - $('#bord_'+windowviewid).remove();
3408   - }
3409   -
3410   - if (TermAnnotationText.length > 0) {
3411   - for (var i = 0; i <= TermAnnotationText.length - 1; i++) {
3412 3152  
3413   - $scope.MultiLanguageAnnationArray.push(TermAnnotationText[i]);
3414   - }
3415   -
3416   - console.log('2. annotationText: ' + annotationText + ' , length: ' + $scope.MultiLanguageAnnationArray.length);
  3153 + }
3417 3154  
3418   - $scope.createDynamicSpeechBubble(evt, evt.pageX + horizontlScrollPosition - $('#canvasDivDA_' + windowviewid).offset().left, evt.pageY + verticalScrollPosition - $('#canvasDivDA_' + windowviewid).offset().top, true, 0, 0, windowviewid, RGBColor);
3419   - }
3420   - //Remove previous SpeechBubble with termnumber
3421   - var TermAnnotationText = $scope.GetwindowStoreData(windowviewid, 'TermAnnotationText');
3422   - if (preTermData != undefined && preTermData.length > 0) {
3423   - for (var i = 0; i < preTermData.length; i++) {
3424   - if (preTermData[i].termNumber != parseInt(RGBColor)) {
3425   - if ($('#sppeachBubble_' + windowviewid + '-' + preTermData[i].termNumber).length > 0) {
3426   - $('#sppeachBubble_' + windowviewid + '-' + preTermData[i].termNumber).remove();
3427   - }
3428   - if ($('#sppeachBubble_annotation_' + windowviewid + '-' + preTermData[i].transparentTermNumber).length > 0) {
3429   - $('#sppeachBubble_annotation_' + windowviewid + '-' + preTermData[i].transparentTermNumber).remove();
3430   - }
3431   - }
3432   -
3433   - }
3434   - }
3435   -
3436   - }
3437   - else {
3438   - $scope.MultiLanguageAnnationArray = [];
3439   - if (TermAnnotationText.length > 0) {
3440   - for (var i = 0; i <= TermAnnotationText.length - 1; i++) {
  3155 + imgCanvas.addEventListener('click', function (evt) {
3441 3156  
3442   - $scope.MultiLanguageAnnationArray.push(TermAnnotationText[i]);
3443   - }
  3157 + $scope.imageCanvasClickAnnotation(imgCanvas,x,y,evt);
3444 3158  
3445   - console.log('3. annotationText: ' + annotationText + ' , length: ' + $scope.MultiLanguageAnnationArray.length);
  3159 + },false);
3446 3160  
3447   - $scope.createDynamicSpeechBubble(evt, evt.pageX + horizontlScrollPosition - $('#canvasDivDA_' + windowviewid).offset().left, evt.pageY + verticalScrollPosition - $('#canvasDivDA_' + windowviewid).offset().top, true, 0, 0, windowviewid, RGBColor);
3448   - }
3449   - }
  3161 + imgCanvas.addEventListener('touchstart', function (evt) {
3450 3162  
  3163 + $scope.imageCanvasClickAnnotation(imgCanvas,x,y,evt);
3451 3164  
3452   - }
3453   - }, false);
  3165 + },false);
3454 3166  
3455 3167 var PI = Math.PI;
3456 3168 var PI2 = PI * 2;
... ... @@ -3463,8 +3175,6 @@ AIA.controller(&quot;DAController&quot;, [&quot;$scope&quot;, &quot;$rootScope&quot;, &quot;$compile&quot;, &quot;$http&quot;, &quot;$l
3463 3175  
3464 3176 img.src = src;
3465 3177  
3466   -
3467   -
3468 3178 function start() {
3469 3179  
3470 3180 context.drawImage(img, 0, 0);
... ... @@ -3650,6 +3360,237 @@ AIA.controller(&quot;DAController&quot;, [&quot;$scope&quot;, &quot;$rootScope&quot;, &quot;$compile&quot;, &quot;$http&quot;, &quot;$l
3650 3360 document.getElementById('canvasDivDA_' + windowviewid).appendChild(imgCanvas);
3651 3361 }
3652 3362  
  3363 + $scope.imageCanvasClickAnnotation =function(imgCanvas,BodyRegoinX,BodyRegoinY,evt)
  3364 + {
  3365 + $rootScope.UnsaveCurriculum = true;
  3366 + var len= (evt.target.id).split("_").length;
  3367 + var windowviewid = (evt.target.id).split("_")[len-1];
  3368 + var canvasDiv = document.getElementById('canvasDivDA_' + windowviewid);
  3369 + $scope.imageVerticalScrollPosition = canvasDiv.scrollTop;
  3370 + if ($scope.isLayerChange == true) {
  3371 + $scope.isLayerChange = false;
  3372 + }
  3373 + //birendra
  3374 + // for mac os Command key use for multi selection
  3375 + if (evt.ctrlKey || evt.metaKey) {
  3376 + $scope.SetwindowStoreData(windowviewid,'multiAnnotationIsON',true);
  3377 +
  3378 + console.log('CTRL ON')
  3379 + }
  3380 + else
  3381 + {
  3382 + $scope.SetwindowStoreData(windowviewid,'isListManagerSelected',false);
  3383 + $('#typedTermName_' + windowviewid).val('');
  3384 + $scope.SetwindowStoreData(windowviewid, 'fullTermlist', []);
  3385 + $scope.SetwindowStoreData(windowviewid, 'AllTerms', []);
  3386 + $scope.SetwindowStoreData(windowviewid,'previousHighlightList',[]);
  3387 + $scope.SetwindowStoreData(windowviewid, 'multiAnnotationIsON', false);
  3388 + console.log('multiAnnotationIsON: ' + false);
  3389 +
  3390 + }
  3391 +
  3392 + var annotationText;
  3393 + var context = imgCanvas.getContext("2d");
  3394 +
  3395 + var canvasId = context.canvas.getAttribute('id');
  3396 + var maskCanvasId;
  3397 + //for leaf canvas
  3398 + if (canvasId.match('modestyImg')) {
  3399 + maskCanvasId = canvasId;
  3400 + }
  3401 + else {
  3402 + maskCanvasId = canvasId.split("_")[0] + '_mci' + "_" + windowviewid;
  3403 + }
  3404 + var maskCanvas = document.getElementById(maskCanvasId);
  3405 + var maskCanvasContext = maskCanvas.getContext("2d");
  3406 +
  3407 + var MousePositionX=0;
  3408 + var MousePositionY=0;
  3409 + var $ua = navigator.userAgent;
  3410 + if (($ua.match(/(iPod|iPhone|iPad|android)/i))) {
  3411 + // var touch = e.originalEvent.touches[0] || e.originalEvent.changedTouches[0];
  3412 + if(evt.touches!=undefined ||evt.changedTouches!=undefined)
  3413 + {
  3414 + var touch = evt.touches[0] || evt.changedTouches[0];
  3415 + MousePositionX=touch.pageX ;
  3416 + MousePositionY=touch.pageY ;
  3417 + }
  3418 + else return;
  3419 + }
  3420 + else
  3421 + {
  3422 + MousePositionX=evt.pageX ;
  3423 + MousePositionY=evt.pageY ;
  3424 +
  3425 + }
  3426 +
  3427 + var mousePos = $scope.getMousePos(MousePositionX,MousePositionY,windowviewid);
  3428 +
  3429 + var canvasDiv = document.getElementById('canvasDivDA_' + windowviewid);
  3430 + //changing for mac os now
  3431 + var os=$scope.getOS();
  3432 + if(os=='MacOS')
  3433 + {
  3434 + var verticalScrollPosition = Math.round(canvasDiv.scrollTop)-2;
  3435 + var horizontlScrollPosition = Math.round(canvasDiv.scrollLeft)-2;
  3436 + }
  3437 + else
  3438 + {
  3439 + var verticalScrollPosition = Math.round(canvasDiv.scrollTop)-1;
  3440 + var horizontlScrollPosition = Math.round(canvasDiv.scrollLeft)-1;
  3441 + }
  3442 +
  3443 + //We substracted 135, as the difference between flex and html coordinates for same organ is 135
  3444 +
  3445 + var actulalX = mousePos.x + horizontlScrollPosition;
  3446 + var actualY = mousePos.y + verticalScrollPosition;
  3447 +
  3448 + var RGBColor = $scope.GetRGBColor(maskCanvasContext, actulalX, actualY, BodyRegoinX, BodyRegoinY);
  3449 +
  3450 +
  3451 + //Modesty ON
  3452 + if (maskCanvasId.match('modestyImg') && RGBColor != '000000') {
  3453 + RGBColor = DA[0].figLeafTermId;
  3454 + annotationText = $scope.GetAnnotationBasedOnActualTermNo(RGBColor, null, windowviewid);
  3455 + }
  3456 + //Modesty On but clicked somewhre else, we did modesty check because the modesty image covers whole body region so if user will click to
  3457 + //see the annotation apart from leaf then the actual click will be on modesty canvas, but for annotation er
  3458 + //
  3459 + else if (maskCanvasId.match('modestyImg') && RGBColor == '000000') {
  3460 +
  3461 + bodyRegionId = maskCanvasId.split("_")[0].slice(-1);
  3462 + maskCanvasId = 'imageCanvas' + bodyRegionId + '_mci' + "_" + windowviewid;
  3463 +
  3464 + var maskCanvas = document.getElementById(maskCanvasId);
  3465 + var maskCanvasContext = maskCanvas.getContext("2d");
  3466 + RGBColor = $scope.GetRGBColor(maskCanvasContext, actulalX, actualY, BodyRegoinX, BodyRegoinY);
  3467 +
  3468 + }
  3469 + else {
  3470 + RGBColor = $scope.GetRGBColor(maskCanvasContext, actulalX, actualY, BodyRegoinX, BodyRegoinY);
  3471 +
  3472 + }
  3473 + var TermNData=$scope.GetwindowStoreData(windowviewid,'TermNumberData');
  3474 + if (TermNData != null && TermNData != undefined) {
  3475 + annotationText = $scope.GetAnnotationText(parseInt(RGBColor),windowviewid);
  3476 +
  3477 + }
  3478 + else {
  3479 + $rootScope.daloadSearchData(windowviewid);
  3480 + annotationText = $scope.GetAnnotationText(parseInt(RGBColor),windowviewid);
  3481 +
  3482 + }
  3483 + var previousHighlightList=$scope.GetwindowStoreData(windowviewid,'previousHighlightList');
  3484 +
  3485 + previousHighlightList.push(RGBColor);
  3486 +
  3487 + //Save Term Number to Showing Annotaion for CB Module
  3488 + var AllTerms = $scope.GetwindowStoreData(windowviewid, 'AllTerms');
  3489 + AllTerms.push({ '_TermNumber': RGBColor });
  3490 + var fullTermlist = $scope.GetwindowStoreData(windowviewid, 'fullTermlist');
  3491 + fullTermlist.push(parseInt(RGBColor));
  3492 +
  3493 + if ($scope.GetwindowStoreData(windowviewid,'isHighLight') == true) {
  3494 + if ($scope.machedIcolorInBodyRegion != null || $scope.machedIcolorInBodyRegion != undefined) {
  3495 + if ($scope.machedIcolorInBodyRegion.length > 0) {
  3496 + if ($scope.GetwindowStoreData(windowviewid,'multiAnnotationIsON') == false) {
  3497 + for (var i = 0; i < $scope.machedIcolorInBodyRegion.length; i++) {
  3498 + var bodyRegionId = $scope.machedIcolorInBodyRegion[i];
  3499 +
  3500 + var grayCanvasID = 'imageCanvas' + bodyRegionId + "_" + windowviewid;
  3501 + var grayCanvas = document.getElementById(grayCanvasID);
  3502 + var grayImageDataList=$scope.GetwindowStoreData(windowviewid,'grayImageDataList');
  3503 + var grayCanvasContext = grayCanvas.getContext("2d");
  3504 + if (grayImageDataList[bodyRegionId - 1] != null || grayImageDataList[bodyRegionId - 1] != undefined) {
  3505 + var grayImageData = grayImageDataList[bodyRegionId - 1];
  3506 + grayCanvasContext.putImageData(grayImageData, 0, 0);
  3507 + }
  3508 + var bodyVid=$scope.GetwindowStoreData(windowviewid,'voId');
  3509 + // for unhighlight the mirrored body region
  3510 + if (bodyVid == "1" || bodyVid == "4" || bodyVid == "5" || bodyVid == "8") {
  3511 + if (bodyRegionId == 4 || bodyRegionId == 5 || bodyRegionId == 6) {
  3512 + var grayCanvasID = 'imageCanvas' + bodyRegionId + '_MR' + "_" + windowviewid;
  3513 + var grayCanvasMR = document.getElementById(grayCanvasID);
  3514 + var grayImageMRDataList=$scope.GetwindowStoreData(windowviewid,'grayImageMRDataList');
  3515 + var grayCanvasContextMR = grayCanvasMR.getContext("2d");
  3516 +
  3517 + if (grayImageMRDataList[bodyRegionId] != null || grayImageMRDataList[bodyRegionId] != undefined) {
  3518 +
  3519 + var grayImageDataMR = grayImageMRDataList[bodyRegionId];
  3520 +
  3521 + grayCanvasContextMR.putImageData(grayImageDataMR, 0, 0);
  3522 +
  3523 + }
  3524 + }
  3525 + }
  3526 +
  3527 + }
  3528 + }
  3529 + }
  3530 + }
  3531 +
  3532 + if (maskCanvasId.match('modestyImg') && RGBColor != '000000') { }
  3533 + else
  3534 + {
  3535 + $scope.highLightBodyBasedOnIcolor(RGBColor,windowviewid);
  3536 + }
  3537 +
  3538 + }
  3539 +
  3540 + //extarct clisked body part is extarct button is already enabled.
  3541 + if ($scope.GetwindowStoreData(windowviewid,'isExtract') == true) {
  3542 + if ($scope.GetwindowStoreData(windowviewid,'multiAnnotationIsON') == false) {
  3543 + $scope.SetwindowStoreData(windowviewid,'isListManagerSelected',false);
  3544 + }
  3545 + $scope.enableExtract(false,windowviewid);
  3546 + }
  3547 +
  3548 + var TermAnnotationText=$scope.GetwindowStoreData(windowviewid,'TermAnnotationText');
  3549 + if ($scope.GetwindowStoreData(windowviewid,'multiAnnotationIsON') == true) {
  3550 +
  3551 + if (TermAnnotationText.length > 0) {
  3552 + $scope.MultiLanguageAnnationArray = [];
  3553 + for (var i = 0; i <= TermAnnotationText.length - 1; i++) {
  3554 +
  3555 + $scope.MultiLanguageAnnationArray.push(TermAnnotationText[i]);
  3556 + }
  3557 +
  3558 + $scope.createDynamicSpeechBubble(evt, MousePositionX + horizontlScrollPosition - $('#canvasDivDA_' + windowviewid).offset().left, MousePositionY + verticalScrollPosition - $('#canvasDivDA_' + windowviewid).offset().top, true, 0, 0, windowviewid, RGBColor);
  3559 + }
  3560 +
  3561 + }
  3562 + else
  3563 + {
  3564 + $scope.saveTermNumberForSaveCB(windowviewid,RGBColor);
  3565 + $scope.MultiLanguageAnnationArray = [];
  3566 +
  3567 + if (TermAnnotationText.length > 0) {
  3568 + for (var i = 0; i <= TermAnnotationText.length - 1; i++) {
  3569 +
  3570 + $scope.MultiLanguageAnnationArray.push(TermAnnotationText[i]);
  3571 + }
  3572 +
  3573 + console.log('2. annotationText: ' + annotationText + ' , length: ' + $scope.MultiLanguageAnnationArray.length);
  3574 +
  3575 + $scope.createDynamicSpeechBubble(evt, MousePositionX + horizontlScrollPosition - $('#canvasDivDA_' + windowviewid).offset().left, MousePositionY + verticalScrollPosition - $('#canvasDivDA_' + windowviewid).offset().top, true, 0, 0, windowviewid, RGBColor);
  3576 + }
  3577 +
  3578 + }
  3579 +
  3580 + var CurriculumTermData = $scope.GetwindowStoreData(windowviewid, 'CurriculumTermData');
  3581 + CurriculumTermData.push({
  3582 + "transparentTermNumber": 0,
  3583 + "termNumber": parseInt(RGBColor),
  3584 + "istpboxTerm":0,
  3585 + "tips_x": parseInt( MousePositionX + horizontlScrollPosition - $('#canvasDivDA_' + windowviewid).offset().left) + 30,
  3586 + "tips_y": parseInt( MousePositionY + verticalScrollPosition - $('#canvasDivDA_' + windowviewid).offset().top) + 10,
  3587 + "x": MousePositionX + horizontlScrollPosition - $('#canvasDivDA_' + windowviewid).offset().left,
  3588 + "y": MousePositionY + verticalScrollPosition - $('#canvasDivDA_' + windowviewid).offset().top
  3589 + });
  3590 +
  3591 +
  3592 + }
  3593 +
3653 3594 $scope.ShowCBDataBodyView = function(windowviewid)
3654 3595 {
3655 3596 // added by Birendra
... ... @@ -4960,59 +4901,13 @@ AIA.controller(&quot;DAController&quot;, [&quot;$scope&quot;, &quot;$rootScope&quot;, &quot;$compile&quot;, &quot;$http&quot;, &quot;$l
4960 4901 $("#layerChangeSliderDA_" + windowviewid).slider("option", "value", sliderVal);
4961 4902  
4962 4903 // Annotations Closing Code
4963   -
4964   - $('.com_anno_'+windowviewid).remove();
4965   -
4966   - $('#sppeachBubble_annotation_'+windowviewid).remove();
4967   - $('#dot_annotation_'+windowviewid).remove();
4968   - $('#bord_annotation_'+windowviewid).remove();
4969   -
4970   - $('#dot_'+windowviewid).remove();
4971   - $('#sppeachBubble_'+windowviewid).remove();
4972   - $('.com_'+windowviewid).remove();
4973   - $('#bord_' + windowviewid).remove();
4974   -
4975   - $('#bord_annotation_' + windowviewid).css({ "width": "0px", "display": "none" });
4976   - $('.dynCross_anno_' + windowviewid).parent().parent().parent().remove();
4977   - if ($('#dot_' + windowviewid).length > 0) {
4978   - $('#dot_' + windowviewid).remove();
4979   - }
4980   - if ($('#sppeachBubble_' + windowviewid).length > 0) {
4981   - $('#sppeachBubble_' + windowviewid).remove();
4982   - }
4983   - if ($('.com_' + windowviewid).length > 0) {
4984   - $('.com_' + windowviewid).remove();
4985   - }
4986   - if ($('#bord_' + windowviewid).length > 0) {
4987   - $('#bord_' + windowviewid).remove();
4988   - }
4989   - if ($('#sppeachBubble_annotation_' + windowviewid).length > 0) {
4990   - $('#sppeachBubble_annotation_' + windowviewid).remove();
4991   - }
4992   - if ($('#bord_annotation_' + windowviewid).length > 0) {
4993   - $('#bord_annotation_' + windowviewid).remove();
4994   - }
4995   - if ($('#dot_annotation_' + windowviewid).length > 0) {
4996   - $('#dot_annotation_' + windowviewid).remove();
4997   - }
4998   - var CurriculumTermData = $scope.GetwindowStoreData(windowviewid, 'CurriculumTermData');
4999   - if (CurriculumTermData != undefined && CurriculumTermData.length > 0) {
5000   - for (var i = 0; i < CurriculumTermData.length; i++) {
5001   - if ($('#sppeachBubble_' + windowviewid + '-' + CurriculumTermData[i].termNumber).length > 0) {
5002   - $('#sppeachBubble_' + windowviewid + '-' + CurriculumTermData[i].termNumber).remove();
5003   - }
5004   - if ($('#sppeachBubble_annotation_' + windowviewid + '-' + CurriculumTermData[i].transparentTermNumber).length > 0) {
5005   - $('#sppeachBubble_annotation_' + windowviewid + '-' + CurriculumTermData[i].transparentTermNumber).remove();
5006   - }
5007   - }
5008   - }
  4904 + $scope.removeAllTermNumberForSaveCB(windowviewid);
5009 4905  
5010 4906 //Remove Annotaion for Slide Changes to Save CB
5011 4907 $scope.SetwindowStoreData(windowviewid, 'previousHighlightList', []);
5012 4908 $scope.SetwindowStoreData(windowviewid, 'AllTerms', []);
5013 4909 $scope.SetwindowStoreData(windowviewid, 'fullTermlist', []);
5014   - $scope.SetwindowStoreData(windowviewid, 'CurriculumTermData', []);
5015   -
  4910 +
5016 4911 $('#typedTermName_' + windowviewid).val('');
5017 4912  
5018 4913 if (($("#canvasPaintDA_"+windowviewid).css("display") == "block") && ($("#canvasDA_"+windowviewid).css("display") == "block")) {
... ... @@ -5086,6 +4981,7 @@ AIA.controller(&quot;DAController&quot;, [&quot;$scope&quot;, &quot;$rootScope&quot;, &quot;$compile&quot;, &quot;$http&quot;, &quot;$l
5086 4981  
5087 4982 $scope.createDynamicSpeechBubble = function (event, x, y, isAnnotationNotForTBox, tipx, tipy,windowviewid, termNumber) {
5088 4983  
  4984 + var termNumber=parseInt(termNumber);
5089 4985 if (isAnnotationNotForTBox == true) {
5090 4986 if ($scope.MultiLanguageAnnationArray.length > 1) {
5091 4987 $scope.longestAnnotation = $scope.MultiLanguageAnnationArray.reduce(function (firstAnnotation, seconAnnotation) { return firstAnnotation.length > seconAnnotation.length ? firstAnnotation : seconAnnotation; });
... ... @@ -5106,7 +5002,7 @@ AIA.controller(&quot;DAController&quot;, [&quot;$scope&quot;, &quot;$rootScope&quot;, &quot;$compile&quot;, &quot;$http&quot;, &quot;$l
5106 5002 speechBubbleCounter = speechBubbleCounter + 1;
5107 5003 $scope.SetwindowStoreData(windowviewid, 'speechBubbleCounter', speechBubbleCounter);
5108 5004  
5109   - if (termNumber != undefined && termNumber != 0) {
  5005 + if (termNumber != undefined ) {
5110 5006 var id = "speechBubble" + speechBubbleCounter + '_' + windowviewid + '-' + termNumber;//Add by Sandy for Save Annotation
5111 5007 }
5112 5008  
... ... @@ -5374,31 +5270,7 @@ AIA.controller(&quot;DAController&quot;, [&quot;$scope&quot;, &quot;$rootScope&quot;, &quot;$compile&quot;, &quot;$http&quot;, &quot;$l
5374 5270 }
5375 5271 else {
5376 5272  
5377   - $scope.SetwindowStoreData(windowviewid,'multiAnnotationIsON',false);
5378   - $('#bord_annotation_'+windowviewid).css({ "width": "0px", "display": "none" });
5379   - $('.dynCross_anno_' + windowviewid).parent().parent().parent().remove();
5380   -
5381   - if ($('#dot_' + windowviewid).length > 0) {
5382   - $('#dot_' + windowviewid).remove();
5383   - }
5384   - if ($('#sppeachBubble_' + windowviewid).length > 0) {
5385   - $('#sppeachBubble_' + windowviewid).remove();
5386   - }
5387   - if ($('.com_' + windowviewid).length > 0) {
5388   - $('.com_' + windowviewid).remove();
5389   - }
5390   - if ($('#bord_' + windowviewid).length > 0) {
5391   - $('#bord_' + windowviewid).remove();
5392   - }
5393   - if ($('#sppeachBubble_annotation_' + windowviewid).length > 0) {
5394   - $('#sppeachBubble_annotation_' + windowviewid).remove();
5395   - }
5396   - if ($('#bord_annotation_' + windowviewid).length > 0) {
5397   - $('#bord_annotation_' + windowviewid).remove();
5398   - }
5399   - if ($('#dot_annotation_' + windowviewid).length > 0) {
5400   - $('#dot_annotation_' + windowviewid).remove();
5401   - }
  5273 + $scope.SetwindowStoreData(windowviewid,'multiAnnotationIsON',false);
5402 5274  
5403 5275 $scope.createSpeechBubbleBasedOnTransparencyWithoutCtrl(x, y,windowviewid, termNumber);
5404 5276 $('#sppeachBubble_annotation_' + windowviewid + '-' + termNumber).draggable(
... ... @@ -5444,10 +5316,7 @@ AIA.controller(&quot;DAController&quot;, [&quot;$scope&quot;, &quot;$rootScope&quot;, &quot;$compile&quot;, &quot;$http&quot;, &quot;$l
5444 5316 $('.crossDiv_annotation_'+windowviewid).on('click', function (evt) {
5445 5317 var len= (evt.target.className).split("_").length;
5446 5318 var windid = (evt.target.className).split("_")[len-1];
5447   - $('#sppeachBubble_annotation_'+windid).remove();
5448   - $('#bord_annotation_'+windid).remove();
5449   - $('#dot_annotation_' + windid).remove();
5450   -
  5319 +
5451 5320 //Delete Annotation in case of show multipule annotation
5452 5321 var removeid = $(this).parent().parent().attr('id');
5453 5322 var termNumber = removeid.split("-")[1];
... ... @@ -5462,6 +5331,9 @@ AIA.controller(&quot;DAController&quot;, [&quot;$scope&quot;, &quot;$rootScope&quot;, &quot;$compile&quot;, &quot;$http&quot;, &quot;$l
5462 5331 $rootScope.UnsaveCurriculum = true;
5463 5332 }
5464 5333 $('#' + removeid).remove();
  5334 + $('#bord_annotation_'+windid).remove();
  5335 + $('#dot_annotation_' + windid).remove();
  5336 +
5465 5337 });
5466 5338 }
5467 5339 }
... ... @@ -6117,50 +5989,14 @@ AIA.controller(&quot;DAController&quot;, [&quot;$scope&quot;, &quot;$rootScope&quot;, &quot;$compile&quot;, &quot;$http&quot;, &quot;$l
6117 5989  
6118 5990 function mouseUpListener(e) {
6119 5991 var len = (e.currentTarget.id).split("_").length;
6120   - var windowviewid = (e.currentTarget.id).split("_")[len - 1];
6121   - //to prevent screen scroll on ipad while drawing TB
6122   - e.preventDefault();
6123   - $rootScope.UnsaveCurriculum = true;
6124   - $scope.SetwindowStoreData(windowviewid, 'isTBDrawnOnBodyRegion', false);
6125   - $scope.SetwindowStoreData(windowviewid, 'isTransparencyActivated', true);
6126   - $scope.SetwindowStoreData(windowviewid, 'IsNormalModeBeforeTBDraw', $scope.GetwindowStoreData(windowviewid, 'isNormalMode'));
6127   - $scope.SetwindowStoreData(windowviewid, 'IsHighlightModeBeforeTBDraw', $scope.GetwindowStoreData(windowviewid, 'isHighlight'));
6128   -
6129   - $('#bord_annotation_' + windowviewid).css({ "width": "0px", "display": "none" });
6130   - $('.dynCross_anno_' + windowviewid).parent().parent().parent().remove();
6131   - if ($('#dot_' + windowviewid).length > 0) {
6132   - $('#dot_' + windowviewid).remove();
6133   - }
6134   - if ($('#sppeachBubble_' + windowviewid).length > 0) {
6135   - $('#sppeachBubble_' + windowviewid).remove();
6136   - }
6137   - if ($('.com_' + windowviewid).length > 0) {
6138   - $('.com_' + windowviewid).remove();
6139   - }
6140   - if ($('#bord_' + windowviewid).length > 0) {
6141   - $('#bord_' + windowviewid).remove();
6142   - }
6143   - if ($('#sppeachBubble_annotation_' + windowviewid).length > 0) {
6144   - $('#sppeachBubble_annotation_' + windowviewid).remove();
6145   - }
6146   - if ($('#bord_annotation_' + windowviewid).length > 0) {
6147   - $('#bord_annotation_' + windowviewid).remove();
6148   - }
6149   - if ($('#dot_annotation_' + windowviewid).length > 0) {
6150   - $('#dot_annotation_' + windowviewid).remove();
6151   - }
6152   - var CurriculumTermData = $scope.GetwindowStoreData(windowviewid, 'CurriculumTermData');
6153   - if (CurriculumTermData != undefined && CurriculumTermData.length > 0) {
6154   - for (var i = 0; i < CurriculumTermData.length; i++) {
6155   - if ($('#sppeachBubble_' + windowviewid + '-' + CurriculumTermData[i].termNumber).length > 0) {
6156   - $('#sppeachBubble_' + windowviewid + '-' + CurriculumTermData[i].termNumber).remove();
6157   - }
6158   - if ($('#sppeachBubble_annotation_' + windowviewid + '-' + CurriculumTermData[i].transparentTermNumber).length > 0) {
6159   - $('#sppeachBubble_annotation_' + windowviewid + '-' + CurriculumTermData[i].transparentTermNumber).remove();
6160   - }
6161   - }
6162   - }
6163   - $scope.SetwindowStoreData(windowviewid, 'CurriculumTermData', []);
  5992 + var windowviewid = (e.currentTarget.id).split("_")[len - 1];
  5993 + //to prevent screen scroll on ipad while drawing TB
  5994 + e.preventDefault();
  5995 + $rootScope.UnsaveCurriculum = true;
  5996 + $scope.SetwindowStoreData(windowviewid, 'isTBDrawnOnBodyRegion', false);
  5997 + $scope.SetwindowStoreData(windowviewid, 'isTransparencyActivated', true);
  5998 + $scope.SetwindowStoreData(windowviewid, 'IsNormalModeBeforeTBDraw', $scope.GetwindowStoreData(windowviewid, 'isNormalMode'));
  5999 + $scope.SetwindowStoreData(windowviewid, 'IsHighlightModeBeforeTBDraw', $scope.GetwindowStoreData(windowviewid, 'isHighlight'));
6164 6000  
6165 6001 var previewRectangleWidth = $('.rectangle').width();
6166 6002 var previewRectangleHeight = $('.rectangle').height()
... ... @@ -6255,7 +6091,6 @@ AIA.controller(&quot;DAController&quot;, [&quot;$scope&quot;, &quot;$rootScope&quot;, &quot;$compile&quot;, &quot;$http&quot;, &quot;$l
6255 6091 document.getElementById("canvasDivDA_" + windowviewid).removeEventListener("mousemove", mouseMoveListener);
6256 6092 document.getElementById("canvasDivDA_" + windowviewid).removeEventListener("mouseup", mouseUpListener);
6257 6093  
6258   - var BodyRegionDictionary = $scope.GetwindowStoreData(windowviewid, 'BodyRegionCordinatesData');
6259 6094 document.getElementById("canvasDivDA_" + windowviewid).removeEventListener("touchstart", mouseDownListener);
6260 6095  
6261 6096 document.getElementById("canvasDivDA_" + windowviewid).removeEventListener("touchmove", mouseMoveListener);
... ... @@ -6285,7 +6120,7 @@ AIA.controller(&quot;DAController&quot;, [&quot;$scope&quot;, &quot;$rootScope&quot;, &quot;$compile&quot;, &quot;$http&quot;, &quot;$l
6285 6120 if ($("#DrawMode").hasClass("annotationtoolbartab")) {
6286 6121 if ($scope.GetwindowStoreData(windowviewid, 'isTBoxModestyVisible') == true) {
6287 6122  
6288   - $rootScope.switchCanvas();
  6123 + $rootScope.switchCanvas("daImagePanel_"+windowviewid);
6289 6124  
6290 6125 }
6291 6126 else {
... ... @@ -6305,7 +6140,7 @@ AIA.controller(&quot;DAController&quot;, [&quot;$scope&quot;, &quot;$rootScope&quot;, &quot;$compile&quot;, &quot;$http&quot;, &quot;$l
6305 6140  
6306 6141 }
6307 6142 else {
6308   - $rootScope.switchToTransparencycanvas();
  6143 + $rootScope.switchToTransparencycanvas("daImagePanel_"+windowviewid);
6309 6144 }
6310 6145 }
6311 6146 else {
... ... @@ -6388,6 +6223,8 @@ AIA.controller(&quot;DAController&quot;, [&quot;$scope&quot;, &quot;$rootScope&quot;, &quot;$compile&quot;, &quot;$http&quot;, &quot;$l
6388 6223  
6389 6224 //bind click listener
6390 6225 transparencyCanvas.addEventListener('click', TransparencyCanvasClickListener);
  6226 + //bind touch listener
  6227 + transparencyCanvas.addEventListener('touchstart', TransparencyCanvasClickListener);
6391 6228  
6392 6229 $(".ui-wrapper").css("z-index", $scope.GetwindowStoreData(windowviewid, 'UIWrapperZIndex'));
6393 6230 $(".ui-wrapper").css("left",TransparencyBoxStartX-2+ 'px');
... ... @@ -6585,11 +6422,7 @@ AIA.controller(&quot;DAController&quot;, [&quot;$scope&quot;, &quot;$rootScope&quot;, &quot;$compile&quot;, &quot;$http&quot;, &quot;$l
6585 6422 $scope.SetwindowStoreData(windowviewid, 'isTransparencyActivated', true);
6586 6423 $scope.SetwindowStoreData(windowviewid, 'IsNormalModeBeforeTBDraw', $scope.GetwindowStoreData(windowviewid, 'isNormalMode'));
6587 6424 $scope.SetwindowStoreData(windowviewid, 'IsHighlightModeBeforeTBDraw', $scope.GetwindowStoreData(windowviewid, 'isHighlight'));
6588   - $('.com_' + windowviewid).remove();
6589   - $('#dot_' + windowviewid).remove();
6590   - $('#bord_' + windowviewid).remove();
6591   - $('#sppeachBubble_' + windowviewid).remove();
6592   -
  6425 +
6593 6426 //Get Transparecy attributes from save CB
6594 6427 var transparencyBounds = $scope.GetwindowStoreData(windowviewid, 'transparencyBounds');
6595 6428 $.each(transparencyBounds, function (index, value){
... ... @@ -6680,6 +6513,8 @@ AIA.controller(&quot;DAController&quot;, [&quot;$scope&quot;, &quot;$rootScope&quot;, &quot;$compile&quot;, &quot;$http&quot;, &quot;$l
6680 6513  
6681 6514 //bind click listener
6682 6515 transparencyCanvas.addEventListener('click', TransparencyCanvasClickListener);
  6516 + //bind touch listener
  6517 + transparencyCanvas.addEventListener('touchstart', TransparencyCanvasClickListener);
6683 6518  
6684 6519 $(".ui-wrapper").css("z-index", $scope.GetwindowStoreData(windowviewid, 'UIWrapperZIndex'));
6685 6520 $(".ui-wrapper").css("left",$scope.startX-2+ 'px');
... ... @@ -7098,6 +6933,7 @@ AIA.controller(&quot;DAController&quot;, [&quot;$scope&quot;, &quot;$rootScope&quot;, &quot;$compile&quot;, &quot;$http&quot;, &quot;$l
7098 6933 canvasModesty.style.zIndex = $rootScope.modestyCanvasZindex;
7099 6934  
7100 6935 canvasModesty.addEventListener('click', OnClickModestyTransCanvas);
  6936 + canvasModesty.addEventListener('touchstart', OnClickModestyTransCanvas);
7101 6937  
7102 6938 document.getElementById("canvasDivDA_" + windowviewid).appendChild(canvasModesty);
7103 6939 }
... ... @@ -7665,121 +7501,86 @@ AIA.controller(&quot;DAController&quot;, [&quot;$scope&quot;, &quot;$rootScope&quot;, &quot;$compile&quot;, &quot;$http&quot;, &quot;$l
7665 7501 }
7666 7502 // History Maintained Issue//
7667 7503  
  7504 + $scope.onDrawingCanvasTouch = function (event) {
  7505 + if (event != undefined && (event.target.id).match("canvasDA")) {
  7506 +
  7507 + if ($rootScope.isAnnotaionToolBarDrawingModeActive == false) {
  7508 + $rootScope.getAnnotationTextBasedOnSelectedBodyRegion(event);
  7509 + }
  7510 + }
  7511 +
  7512 + };
  7513 +
7668 7514 $rootScope.getAnnotationTextBasedOnSelectedBodyRegion = function (event) {
7669   - var len= (event.currentTarget.id).split("_").length;
7670   - var windowviewid = (event.currentTarget.id).split("_")[len-1];
  7515 + var len= (event.target.id).split("_").length;
  7516 + var windowviewid = (event.target.id).split("_")[len-1];
7671 7517  
  7518 + $rootScope.isMirrorBodyRegion=undefined;
7672 7519 var canvasDiv = document.getElementById("canvasDivDA_" + windowviewid);
7673 7520 var verticalScrollPosition = canvasDiv.scrollTop;
7674 7521 var horizontlScrollPosition = canvasDiv.scrollLeft;
7675   -
7676   - $rootScope.Xaxis = event.pageX - $('#canvasDivDA_' + windowviewid).offset().left + horizontlScrollPosition;
7677   - $rootScope.Yaxis = event.pageY - $('#canvasDivDA_' + windowviewid).offset().top + verticalScrollPosition;
  7522 + var MousePositionX=0;
  7523 + var MousePositionY=0;
  7524 + var $ua = navigator.userAgent;
  7525 + if (($ua.match(/(iPod|iPhone|iPad|android)/i))) {
  7526 + // var touch = e.originalEvent.touches[0] || e.originalEvent.changedTouches[0];
  7527 + if(event.touches!=undefined ||event.changedTouches!=undefined)
  7528 + {
  7529 + var touch = event.touches[0] || event.changedTouches[0];
  7530 + MousePositionX=touch.pageX ;
  7531 + MousePositionY=touch.pageY ;
  7532 + $rootScope.Xaxis = touch.pageX - $('#canvasDivDA_' + windowviewid).offset().left + horizontlScrollPosition;
  7533 + $rootScope.Yaxis = touch.pageY - $('#canvasDivDA_' + windowviewid).offset().top + verticalScrollPosition;
  7534 + }
  7535 + else return;
  7536 + }
  7537 + else
  7538 + {
  7539 + MousePositionX=event.pageX ;
  7540 + MousePositionY=event.pageY ;
  7541 + $rootScope.Xaxis = event.pageX - $('#canvasDivDA_' + windowviewid).offset().left + horizontlScrollPosition;
  7542 + $rootScope.Yaxis = event.pageY - $('#canvasDivDA_' + windowviewid).offset().top + verticalScrollPosition;
  7543 + }
7678 7544  
7679 7545 $rootScope.setSelectedBodyRegionData(windowviewid);
7680 7546  
  7547 + var gender= $scope.GetwindowStoreData(windowviewid,'genderId');
  7548 + var currentBodyViewId =$scope.GetwindowStoreData(windowviewid,'voId');
  7549 +
  7550 +
7681 7551 if ($rootScope.isMirrorBodyRegion == "No") {
7682   - var maskCanvasId = "imageCanvas" + $rootScope.BRId + "_mci" + "_" + windowviewid;
7683   - var maskCanvas = document.getElementById(maskCanvasId);
7684   - var maskCanvasContext = maskCanvas.getContext("2d");
7685   -
7686   - var actulalX = $rootScope.Xaxis;
7687   - var actualY = $rootScope.Yaxis;
7688   - var RGBColor = $scope.GetRGBColor(maskCanvasContext, actulalX, actualY, $rootScope.BodyRegionXAxis, $rootScope.BodyRegionYAxis);
7689   - var annotationText = $scope.GetAnnotationText(parseInt(RGBColor),windowviewid);
7690   - $scope.NormalTermNumber = RGBColor;
7691   - }
7692   - else {
7693 7552  
7694   - var maskCanvasId = "imageCanvas" + $rootScope.BRId + "_MR_mci"+ "_" + windowviewid;
7695   - var maskoffsetval = $('#' + maskCanvasId).offset();
7696   - var mirrorCanvasX = maskoffsetval.left;
7697   - var mirrorImageCanvas = document.getElementById(maskCanvasId);
7698   - var mirrorCanvasWidth = mirrorImageCanvas.clientWidth;
7699   - var maskCanvas = document.getElementById(maskCanvasId);
7700   - var maskCanvasContext = maskCanvas.getContext("2d");
  7553 + var maskCanvasId = "imageCanvas" + $rootScope.BRId + "_mci" + "_" + windowviewid;
7701 7554  
7702   - var distanceXOnMirrorImage = (parseInt(mirrorCanvasX) + parseInt(mirrorCanvasWidth)) - (parseInt(event.pageX) + horizontlScrollPosition);// - 135);
7703   - var mirrorXOnNormalImage = parseInt(maskCanvasContext.canvas.offsetLeft) + parseInt(distanceXOnMirrorImage);
7704   - var actulalX = mirrorXOnNormalImage;
7705   - var actualY = event.pageY + verticalScrollPosition;
7706   - var pixelData = maskCanvasContext.getImageData(Math.round(actulalX - parseInt(maskCanvasContext.canvas.offsetLeft)), Math.round(actualY - $rootScope.BodyRegionYAxis), 1, 1);
7707   - pixelData.data[0] = pixelData.data[0] - 9;
7708   - pixelData.data[1] = pixelData.data[1] - 9;
7709   - pixelData.data[2] = pixelData.data[2] - 9
7710   - var Red;
7711   - var Green;
7712   - var Blue;
7713   - var zero = "0";
7714   - if ((pixelData.data[0]).toString().length != 2) {
7715   - Red = zero.concat((pixelData.data[0]).toString())
7716   - }
7717   - else {
7718   - Red = (pixelData.data[0]).toString()
7719   - }
7720   - if ((pixelData.data[1]).toString().length != 2) {
7721   - Green = zero.concat((pixelData.data[1]).toString())
7722   - }
7723   - else {
7724   - Green = (pixelData.data[1]).toString()
7725   - }
7726   - if ((pixelData.data[2]).toString().length != 2) {
7727   - Blue = zero.concat((pixelData.data[2]).toString())
7728   - }
7729   - else {
7730   - Blue = (pixelData.data[2]).toString()
  7555 + if($rootScope.BRId=="2" || $rootScope.BRId=="3")
  7556 + {
  7557 + if(gender=="Female" && (currentBodyViewId=="5"))
  7558 + {
  7559 + var maskCanvasId = "imageCanvasmodestyImg" + $rootScope.BRId + "_" + windowviewid;
  7560 + }
  7561 + else if(gender=="Female" && $rootScope.BRId=="2" && (currentBodyViewId=="6"|| currentBodyViewId=="7"|| currentBodyViewId=="11"))
  7562 + {
  7563 + var maskCanvasId = "imageCanvasmodestyImg" + $rootScope.BRId + "_" + windowviewid;
  7564 + }
  7565 + else if(gender=="Male" && $rootScope.BRId=="3" && currentBodyViewId=="1")
  7566 + {
  7567 + var maskCanvasId = "imageCanvasmodestyImg" + $rootScope.BRId + "_" + windowviewid;
  7568 + }
  7569 +
7731 7570 }
7732   - var RGBColor = (Red + Green + Blue);
7733   - $scope.NormalTermNumber = RGBColor;
7734   - }
7735   -
7736   - if (event.ctrlKey || event.metaKey) {
7737   - $scope.SetwindowStoreData(windowviewid, 'multiAnnotationIsON', true);
7738   - }
7739   - else {
7740   - $scope.SetwindowStoreData(windowviewid, 'isListManagerSelected', false);
7741   - $('#typedTermName_' + windowviewid).val('');
7742   - $scope.SetwindowStoreData(windowviewid, 'fullTermlist', []);
7743   - $scope.SetwindowStoreData(windowviewid, 'AllTerms', []);
7744   - $scope.SetwindowStoreData(windowviewid, 'previousHighlightList', []);
7745 7571  
7746   - $scope.SetwindowStoreData(windowviewid, 'multiAnnotationIsON', false);
7747   - $scope.removeAllTermNumberForSaveCB(windowviewid);//Calling Methode for remove Annotations Text
  7572 + var maskCanvas = document.getElementById(maskCanvasId);
  7573 +
  7574 + $scope.imageCanvasClickAnnotation(maskCanvas,$rootScope.BodyRegionXAxis,$rootScope.BodyRegionYAxis,event);
7748 7575  
7749 7576 }
7750   -
7751   - //Save Term Number to Showing Annotaion Text for CB Module
7752   - var RGBColor = $scope.NormalTermNumber;
7753   - var AllTerms = $scope.GetwindowStoreData(windowviewid, 'AllTerms');
7754   - AllTerms.push({ '_TermNumber': RGBColor });
7755   - var fullTermlist = $scope.GetwindowStoreData(windowviewid, 'fullTermlist');
7756   - fullTermlist.push(parseInt(RGBColor));
7757   - var CurriculumTermData = $scope.GetwindowStoreData(windowviewid, 'CurriculumTermData');
7758   - CurriculumTermData.push({
7759   - "transparentTermNumber": 0,
7760   - "termNumber": parseInt(RGBColor),
7761   - "tips_x": parseInt(event.pageX + horizontlScrollPosition - $('#canvasDivDA_' + windowviewid).offset().left) + 30,
7762   - "tips_y": parseInt(event.pageY + verticalScrollPosition - $('#canvasDivDA_' + windowviewid).offset().top) + 10,
7763   - "x": event.pageX + horizontlScrollPosition - $('#canvasDivDA_' + windowviewid).offset().left,
7764   - "y": event.pageY + verticalScrollPosition - $('#canvasDivDA_' + windowviewid).offset().top
7765   - });
7766   -
7767   - $scope.MultiLanguageAnnationArray = [];
7768   -
7769   - var TermAnnotationText=$scope.GetwindowStoreData(windowviewid,'TermAnnotationText');
7770   - for (var i = 0; i <= TermAnnotationText.length - 1; i++) {
7771   -
7772   - $scope.MultiLanguageAnnationArray.push(TermAnnotationText[i]);
7773   - }
7774   - if (TermAnnotationText.length>0) {
7775   - $scope.createDynamicSpeechBubble(event, event.pageX + horizontlScrollPosition - $('#canvasDivDA_' + windowviewid).offset().left, event.pageY + verticalScrollPosition - $('#canvasDivDA_' + windowviewid).offset().top, true, 0, 0, windowviewid, $scope.NormalTermNumber)
  7577 + else
  7578 + {
  7579 + var maskCanvasId = "imageCanvas" + $rootScope.BRId + "_MR"+ "_" + windowviewid;
  7580 + var mirrorImageCanvas = document.getElementById(maskCanvasId);
  7581 + $scope.FlipedImgCanvasClickAnnotation(mirrorImageCanvas,$rootScope.BodyRegionXAxis,$rootScope.BodyRegionYAxis,event);
7776 7582 }
7777   - var previousHighlightList = $scope.GetwindowStoreData(windowviewid, 'previousHighlightList');
7778   -
7779   - previousHighlightList.push(RGBColor);
7780   - if ($scope.GetwindowStoreData(windowviewid,'isHighLight') == true) {
7781   - $scope.highLightBodyBasedOnIcolor(RGBColor, windowviewid);
7782   - }
  7583 +
7783 7584 }
7784 7585  
7785 7586 $rootScope.setSelectedBodyRegionData = function (windowviewid) {
... ... @@ -7873,7 +7674,27 @@ AIA.controller(&quot;DAController&quot;, [&quot;$scope&quot;, &quot;$rootScope&quot;, &quot;$compile&quot;, &quot;$http&quot;, &quot;$l
7873 7674 var windowviewid = (evt.currentTarget.id).split("_")[len-1];
7874 7675 var pixelData;
7875 7676 var pixelDataTrans;
7876   - var mousePos = $scope.getMousePos(evt.pageX,evt.pageY,windowviewid);
  7677 +
  7678 + var MousePositionX=0;
  7679 + var MousePositionY=0;
  7680 + var $ua = navigator.userAgent;
  7681 + if (($ua.match(/(iPod|iPhone|iPad|android)/i))) {
  7682 + // var touch = e.originalEvent.touches[0] || e.originalEvent.changedTouches[0];
  7683 + if(evt.touches!=undefined ||evt.changedTouches!=undefined)
  7684 + {
  7685 + var touch = evt.touches[0] || evt.changedTouches[0];
  7686 + MousePositionX=touch.pageX ;
  7687 + MousePositionY=touch.pageY ;
  7688 + }
  7689 + else return;
  7690 + }
  7691 + else
  7692 + {
  7693 + MousePositionX=evt.pageX ;
  7694 + MousePositionY=evt.pageY ;
  7695 + }
  7696 +
  7697 + var mousePos = $scope.getMousePos(MousePositionX,MousePositionY,windowviewid);
7877 7698  
7878 7699 var canvasDiv = document.getElementById("canvasDivDA_" + windowviewid);
7879 7700 //changing for mac os now
... ... @@ -7964,7 +7785,7 @@ AIA.controller(&quot;DAController&quot;, [&quot;$scope&quot;, &quot;$rootScope&quot;, &quot;$compile&quot;, &quot;$http&quot;, &quot;$l
7964 7785 var maskCanvasContexttrans = maskCanvastrans.getContext("2d");
7965 7786  
7966 7787  
7967   - getAnnotationAndCraeteSpeechBubble(mirrorCanvasX, mirrorCanvasWidth, mousePos, maskCanvasContexttrans, clickedBodyRegion, x, y, evt)
  7788 + getAnnotationAndCraeteSpeechBubble(mirrorCanvasX, mirrorCanvasWidth, mousePos, maskCanvasContexttrans, clickedBodyRegion, x, y, evt,MousePositionX,MousePositionY)
7968 7789  
7969 7790  
7970 7791 }
... ... @@ -8009,7 +7830,7 @@ AIA.controller(&quot;DAController&quot;, [&quot;$scope&quot;, &quot;$rootScope&quot;, &quot;$compile&quot;, &quot;$http&quot;, &quot;$l
8009 7830 x = transparencyTempcanavsMask.style.left;
8010 7831 y = transparencyTempcanavsMask.style.top;
8011 7832  
8012   - getAnnotationAndCraeteSpeechBubble(mirrorCanvasX, mirrorCanvasWidth, mousePos, tempmaskCtx, clickedBodyRegion, x, y, evt)
  7833 + getAnnotationAndCraeteSpeechBubble(mirrorCanvasX, mirrorCanvasWidth, mousePos, tempmaskCtx, clickedBodyRegion, x, y, evt,MousePositionX,MousePositionY)
8013 7834  
8014 7835 }
8015 7836 }
... ... @@ -8039,12 +7860,17 @@ AIA.controller(&quot;DAController&quot;, [&quot;$scope&quot;, &quot;$rootScope&quot;, &quot;$compile&quot;, &quot;$http&quot;, &quot;$l
8039 7860 $scope.annotationTextArrayT1.push($rootScope.annotationTextForTrans1[i]);
8040 7861 }
8041 7862 for (var i = 0; i <= $rootScope.annotationTextForTrans2.length - 1; i++) {
8042   - $scope.annotationTextArrayT2.push($rootScope.annotationTextForTrans2[i]);
8043   - }
8044   - $scope.saveTBoxTermNumberForSaveCB(evt, windowviewid)//Calling Method for Tbox termnumber SaveCB
  7863 + $scope.annotationTextArrayT2.push($rootScope.annotationTextForTrans2[i]);
  7864 +
  7865 + }
  7866 + var TBoxTermNumber=annotations.TBoxTermNumber;
  7867 + var NormalTermNumber=annotations.NormalTermNumber;
  7868 +
  7869 + $scope.saveTBoxTermNumberForSaveCB(evt, windowviewid,TBoxTermNumber,NormalTermNumber,MousePositionX,MousePositionY);//Calling Method for Tbox termnumber SaveCB
  7870 +
8045 7871 var TermAnnotationText=$scope.GetwindowStoreData(windowviewid,'TermAnnotationText');
8046 7872 if (TermAnnotationText.length > 0) {
8047   - $scope.createDynamicSpeechBubble(evt, evt.pageX + horizontlScrollPosition - $('#canvasDivDA_' + windowviewid).offset().left, evt.pageY + verticalScrollPosition - $('#canvasDivDA_' + windowviewid).offset().top, false, 0, 0, windowviewid, $scope.TBoxTermNumber);
  7873 + $scope.createDynamicSpeechBubble(evt, MousePositionX + horizontlScrollPosition - $('#canvasDivDA_' + windowviewid).offset().left, MousePositionY + verticalScrollPosition - $('#canvasDivDA_' + windowviewid).offset().top, false, 0, 0, windowviewid, TBoxTermNumber);
8048 7874 }
8049 7875 }
8050 7876  
... ... @@ -8066,7 +7892,26 @@ AIA.controller(&quot;DAController&quot;, [&quot;$scope&quot;, &quot;$rootScope&quot;, &quot;$compile&quot;, &quot;$http&quot;, &quot;$l
8066 7892 var tCanvasHeightAftrSplit = tCanvasHeight.split("p");
8067 7893 var tCanvasTotalWidth = parseInt(tCanvasLeftAftrSplit[0]) + parseInt(tCanvasWidthAftrSplit[0]);
8068 7894 var tCanvasTotalHeight = parseInt(tCanvasTopAftrSplit[0]) + parseInt(tCanvasHeightAftrSplit[0]);
8069   - var mousePos = $scope.getMousePos(evt.pageX,evt.pageY,windowviewid);
  7895 + var MousePositionX=0;
  7896 + var MousePositionY=0;
  7897 + var $ua = navigator.userAgent;
  7898 + if (($ua.match(/(iPod|iPhone|iPad|android)/i))) {
  7899 + // var touch = e.originalEvent.touches[0] || e.originalEvent.changedTouches[0];
  7900 + if(evt.touches!=undefined ||evt.changedTouches!=undefined)
  7901 + {
  7902 + var touch = evt.touches[0] || evt.changedTouches[0];
  7903 + MousePositionX=touch.pageX ;
  7904 + MousePositionY=touch.pageY ;
  7905 + }
  7906 + else return;
  7907 + }
  7908 + else
  7909 + {
  7910 + MousePositionX=evt.pageX ;
  7911 + MousePositionY=evt.pageY ;
  7912 + }
  7913 +
  7914 + var mousePos = $scope.getMousePos(MousePositionX,MousePositionY,windowviewid);
8070 7915 var canvasDiv = document.getElementById('canvasDivDA_'+windowviewid);
8071 7916 //changing for mac os now
8072 7917 var os=$scope.getOS();
... ... @@ -8102,7 +7947,7 @@ AIA.controller(&quot;DAController&quot;, [&quot;$scope&quot;, &quot;$rootScope&quot;, &quot;$compile&quot;, &quot;$http&quot;, &quot;$l
8102 7947 $scope.annotationTextArrayT2 = [];
8103 7948 $scope.annotationTextArrayT1.push(annotationText);
8104 7949 $scope.annotationTextArrayT2.push(annotationText);
8105   - $scope.TBoxTermNumber = RGBColor;
  7950 + $scope.saveTBoxTermNumberForSaveCB(evt, windowviewid,0,RGBColor,MousePositionX,MousePositionY)//Calling Method for Tbox termnumber SaveCB
8106 7951 }
8107 7952 //Modesty On but clicked somewhre else, we did modesty check because the modesty image covers whole body region so if user will click to
8108 7953 //see the annotation apart from leaf then the actual click will be on modesty canvas, but for annotation er
... ... @@ -8133,11 +7978,16 @@ AIA.controller(&quot;DAController&quot;, [&quot;$scope&quot;, &quot;$rootScope&quot;, &quot;$compile&quot;, &quot;$http&quot;, &quot;$l
8133 7978  
8134 7979 }
8135 7980 for (var i = 0; i <= annotations.annotationT2.length - 1; i++) {
8136   - $scope.annotationTextArrayT2.push(annotations.annotationT2[i]);
  7981 + $scope.annotationTextArrayT2.push(annotations.annotationT2[i]);
8137 7982 }
8138 7983  
  7984 + var TBoxTermNumber=annotations.TBoxTermNumber;
  7985 + var NormalTermNumber=annotations.NormalTermNumber;
  7986 +
  7987 + $scope.saveTBoxTermNumberForSaveCB(evt, windowviewid,TBoxTermNumber,NormalTermNumber,MousePositionX,MousePositionY);//Calling Method for Tbox termnumber SaveCB
  7988 +
8139 7989 }
8140   - $scope.saveTBoxTermNumberForSaveCB(evt, windowviewid)//Calling Method for Tbox termnumber SaveCB
  7990 +
8141 7991 var tCanvasTopPos = $(".ui-wrapper").css("top");
8142 7992 var tCanvasTopPosAftrSplit = tCanvasTopPos.split("p");
8143 7993 var tCanvasHeight = $(".ui-wrapper").css("height");
... ... @@ -8145,7 +7995,7 @@ AIA.controller(&quot;DAController&quot;, [&quot;$scope&quot;, &quot;$rootScope&quot;, &quot;$compile&quot;, &quot;$http&quot;, &quot;$l
8145 7995 var tCanvasAttr = parseInt(tCanvasTopPosAftrSplit[0]) + parseInt(tCanvasHeightAftrSplit[0]);
8146 7996 var TermAnnotationText=$scope.GetwindowStoreData(windowviewid,'TermAnnotationText');
8147 7997 if (TermAnnotationText.length > 0) {
8148   - $scope.createDynamicSpeechBubble(evt, evt.pageX + horizontlScrollPosition - $('#canvasDivDA_' + windowviewid).offset().left, evt.pageY + verticalScrollPosition - $('#canvasDivDA_' + windowviewid).offset().top, false, 0, 0, windowviewid, $scope.TBoxTermNumber);
  7998 + $scope.createDynamicSpeechBubble(evt, evt.pageX + horizontlScrollPosition - $('#canvasDivDA_' + windowviewid).offset().left, evt.pageY + verticalScrollPosition - $('#canvasDivDA_' + windowviewid).offset().top, false, 0, 0, windowviewid, TBoxTermNumber);
8149 7999 }
8150 8000 }
8151 8001 else {
... ... @@ -8153,7 +8003,7 @@ AIA.controller(&quot;DAController&quot;, [&quot;$scope&quot;, &quot;$rootScope&quot;, &quot;$compile&quot;, &quot;$http&quot;, &quot;$l
8153 8003 }
8154 8004 }
8155 8005  
8156   - function getAnnotationAndCraeteSpeechBubble(mirrorCanvasX, mirrorCanvasWidth, mousePos, maskCanvasContexttrans, clickedBodyRegion, x, y, evt) {
  8006 + function getAnnotationAndCraeteSpeechBubble(mirrorCanvasX, mirrorCanvasWidth, mousePos, maskCanvasContexttrans, clickedBodyRegion, x, y, evt,MousePositionX,MousePositionY) {
8157 8007 var len= (evt.target.id).split("_").length;
8158 8008 var windowviewid = (evt.target.id).split("_")[len-1];
8159 8009  
... ... @@ -8198,35 +8048,52 @@ AIA.controller(&quot;DAController&quot;, [&quot;$scope&quot;, &quot;$rootScope&quot;, &quot;$compile&quot;, &quot;$http&quot;, &quot;$l
8198 8048 for (var i = 0; i <= $rootScope.annotationTextForTrans2.length - 1; i++) {
8199 8049 $scope.annotationTextArrayT2.push($rootScope.annotationTextForTrans2[i]);
8200 8050 }
8201   - $scope.saveTBoxTermNumberForSaveCB(evt, windowviewid)//Calling Method for Tbox termnumber SaveCB
  8051 +
  8052 + var TBoxTermNumber=annotations.TBoxTermNumber;
  8053 + var NormalTermNumber=annotations.NormalTermNumber;
  8054 +
  8055 + $scope.saveTBoxTermNumberForSaveCB(evt, windowviewid,TBoxTermNumber,NormalTermNumber,MousePositionX,MousePositionY);//Calling Method for Tbox termnumber SaveCB
  8056 +
8202 8057 var TermAnnotationText=$scope.GetwindowStoreData(windowviewid,'TermAnnotationText');
8203 8058 if (TermAnnotationText.length > 0) {
8204   - $scope.createDynamicSpeechBubble(evt, evt.pageX + horizontlScrollPosition - $('#canvasDivDA_' + windowviewid).offset().left, evt.pageY + verticalScrollPosition - $('#canvasDivDA_' + windowviewid).offset().top, false, 0, 0, windowviewid, $scope.TBoxTermNumber);
  8059 + $scope.createDynamicSpeechBubble(evt, MousePositionX + horizontlScrollPosition - $('#canvasDivDA_' + windowviewid).offset().left, MousePositionY + verticalScrollPosition - $('#canvasDivDA_' + windowviewid).offset().top, false, 0, 0, windowviewid, TBoxTermNumber);
8205 8060 }
8206 8061 }
8207 8062  
8208 8063 //Added Method to Save TransparencyBox TermNumbers for SaveCB
8209   - $scope.saveTBoxTermNumberForSaveCB = function (evt, windowviewid) {
  8064 + $scope.saveTBoxTermNumberForSaveCB = function (evt, windowviewid,TBoxTermNumber,NormalTermNumber,MousePositionX,MousePositionY) {
8210 8065 if (evt.ctrlKey || evt.metaKey) {
8211 8066 $scope.SetwindowStoreData(windowviewid, 'multiAnnotationIsON', true);
8212 8067 }
8213 8068 else {
8214 8069 //Remove previous SpeechBubble with termnumber
8215   - var normalTermNumber = $scope.NormalTermNumber;
8216   - var CurriculumTermData = $scope.GetwindowStoreData(windowviewid, 'CurriculumTermData');
8217   - if (CurriculumTermData != undefined && CurriculumTermData.length > 0) {
8218   - for (var i = 0; i < CurriculumTermData.length; i++) {
8219   - //if (CurriculumTermData[i].termNumber != parseInt(normalTermNumber)) {
8220   - if ($('#sppeachBubble_annotation_' + windowviewid + '-' + CurriculumTermData[i].transparentTermNumber).length > 0) {
8221   - $('#sppeachBubble_annotation_' + windowviewid + '-' + CurriculumTermData[i].transparentTermNumber).remove();
8222   - }
8223   - if ($('#sppeachBubble_' + windowviewid + '-' + CurriculumTermData[i].termNumber).length > 0) {
8224   - $('#sppeachBubble_' + windowviewid + '-' + CurriculumTermData[i].termNumber).remove();
8225   - }
8226   - //}
  8070 +
  8071 + var preTermData = $scope.GetwindowStoreData(windowviewid, 'CurriculumTermData');
  8072 + if (preTermData != undefined && preTermData.length > 0) {
  8073 + for (var i = 0; i < preTermData.length; i++) {
  8074 + if (preTermData[i].transparentTermNumber != parseInt(TBoxTermNumber)) {
  8075 +
  8076 + var CurriculumTermData = [];
  8077 + CurriculumTermData = $scope.GetwindowStoreData(windowviewid, 'CurriculumTermData');
  8078 + CurriculumTermData = new jinqJs()
  8079 + .from(CurriculumTermData)
  8080 + .delete().at("transparentTermNumber == " + preTermData[i].transparentTermNumber,'istpboxTerm == ' + 1).select();
  8081 +
  8082 + $scope.SetwindowStoreData(windowviewid, 'CurriculumTermData', CurriculumTermData);
  8083 + }
  8084 +
8227 8085 }
8228 8086 }
8229   - $scope.SetwindowStoreData(windowviewid, 'CurriculumTermData', []);
  8087 +
  8088 + // remove all in multi annotation
  8089 + $('.com_anno_' + windowviewid).remove();
  8090 + // $('.dynCross_anno_' + windowviewid).parent().parent().parent().remove();
  8091 +
  8092 + // remove all in single annotation
  8093 + $('.crossDiv_annotation_' + windowviewid).parent().parent().remove();
  8094 + $('#bord_annotation_' + windowviewid).remove();
  8095 + $('#dot_annotation_' + windowviewid).remove();
  8096 +
8230 8097 $scope.SetwindowStoreData(windowviewid, 'multiAnnotationIsON', false);
8231 8098 }
8232 8099 var canvasDiv = document.getElementById('canvasDivDA_' + windowviewid);
... ... @@ -8244,56 +8111,101 @@ AIA.controller(&quot;DAController&quot;, [&quot;$scope&quot;, &quot;$rootScope&quot;, &quot;$compile&quot;, &quot;$http&quot;, &quot;$l
8244 8111 }
8245 8112 var CurriculumTermData = $scope.GetwindowStoreData(windowviewid, 'CurriculumTermData');
8246 8113 CurriculumTermData.push({
8247   - "transparentTermNumber": parseInt($scope.TBoxTermNumber),
8248   - "termNumber": parseInt($scope.NormalTermNumber),
8249   - "tips_x": parseInt(evt.pageX + horizontlScrollPosition - $('#canvasDivDA_' + windowviewid).offset().left) + 30,
8250   - "tips_y": parseInt(evt.pageY + verticalScrollPosition - $('#canvasDivDA_' + windowviewid).offset().top) + 10,
8251   - "x": evt.pageX + horizontlScrollPosition - $('#canvasDivDA_' + windowviewid).offset().left,
8252   - "y": evt.pageY + verticalScrollPosition - $('#canvasDivDA_' + windowviewid).offset().top
  8114 + "transparentTermNumber": parseInt(TBoxTermNumber),
  8115 + "termNumber": parseInt(NormalTermNumber),
  8116 + "istpboxTerm":1,
  8117 + "tips_x": parseInt(MousePositionX + horizontlScrollPosition - $('#canvasDivDA_' + windowviewid).offset().left) + 30,
  8118 + "tips_y": parseInt(MousePositionY + verticalScrollPosition - $('#canvasDivDA_' + windowviewid).offset().top) + 10,
  8119 + "x": MousePositionX + horizontlScrollPosition - $('#canvasDivDA_' + windowviewid).offset().left,
  8120 + "y": MousePositionY + verticalScrollPosition - $('#canvasDivDA_' + windowviewid).offset().top
8253 8121 });
8254 8122 $scope.SetwindowStoreData(windowviewid, 'CurriculumTermData', CurriculumTermData);
8255 8123  
8256 8124 }
8257   - //Added method to remove All Previous Annotations Text Fro SaveCB
8258   - $scope.removeAllTermNumberForSaveCB = function (windowviewid) {
  8125 +
  8126 + //Remove all TP term while close box
  8127 + $scope.removeAllTermTpClose = function (windowviewid) {
  8128 +
8259 8129 var preTermData = $scope.GetwindowStoreData(windowviewid, 'CurriculumTermData');
8260   - $scope.SetwindowStoreData(windowviewid, 'CurriculumTermData', []);
8261 8130 if (preTermData != undefined && preTermData.length > 0) {
8262 8131 for (var i = 0; i < preTermData.length; i++) {
8263   - if (preTermData[i].termNumber != parseInt($scope.NormalTermNumber)) {
8264   - if ($('#sppeachBubble_' + windowviewid + '-' + preTermData[i].termNumber).length > 0) {
8265   - $('#sppeachBubble_' + windowviewid + '-' + preTermData[i].termNumber).remove();
8266   - }
8267   - }
8268   - if ($('#sppeachBubble_annotation_' + windowviewid + '-' + preTermData[i].transparentTermNumber).length > 0) {
8269   - $('#sppeachBubble_annotation_' + windowviewid + '-' + preTermData[i].transparentTermNumber).remove();
8270   - }
  8132 +
  8133 + var CurriculumTermData = [];
  8134 + CurriculumTermData = $scope.GetwindowStoreData(windowviewid, 'CurriculumTermData');
  8135 + CurriculumTermData = new jinqJs()
  8136 + .from(CurriculumTermData)
  8137 + .delete().at('istpboxTerm == ' + 1).select();
  8138 +
  8139 + $scope.SetwindowStoreData(windowviewid, 'CurriculumTermData', CurriculumTermData);
  8140 +
8271 8141 }
8272 8142 }
  8143 +
  8144 + // remove all in multi annotation
  8145 + $('.dynCross_anno_' + windowviewid).parent().parent().parent().remove();
8273 8146  
8274   - if ($('#sppeachBubble_annotation_' + windowviewid).length > 0) {
8275   - $('#sppeachBubble_annotation_' + windowviewid).remove();
8276   - }
8277   - if ($('#bord_annotation_' + windowviewid).length > 0) {
8278   - $('#bord_annotation_' + windowviewid).remove();
8279   - }
8280   - if ($('#dot_annotation_' + windowviewid).length > 0) {
8281   - $('#dot_annotation_' + windowviewid).remove();
8282   - }
8283   - $('#bord_annotation_' + windowviewid).css({ "width": "0px", "display": "none" });
8284   - $('.dynCross_anno_' + windowviewid).parent().parent().parent().remove();
8285   - if ($('#dot_' + windowviewid).length > 0) {
8286   - $('#dot_' + windowviewid).remove();
8287   - if ($('#sppeachBubble_' + windowviewid).length > 0) {
8288   - $('#sppeachBubble_' + windowviewid).remove();
8289   - }
8290   - if ($('.com_' + windowviewid).length > 0) {
8291   - $('.com_' + windowviewid).remove();
8292   - }
8293   - if ($('#bord_' + windowviewid).length > 0) {
8294   - $('#bord_' + windowviewid).remove();
  8147 + // remove all in single annotation
  8148 + $('.crossDiv_annotation_' + windowviewid).parent().parent().remove();
  8149 + $('#bord_annotation_' + windowviewid).remove();
  8150 + $('#dot_annotation_' + windowviewid).remove();
  8151 +
  8152 + $scope.SetwindowStoreData(windowviewid, 'multiAnnotationIsON', false);
  8153 +
  8154 + }
  8155 +
  8156 +
  8157 + //Added method to remove All Previous Annotations Text Fro SaveCB
  8158 + $scope.removeAllTermNumberForSaveCB = function (windowviewid) {
  8159 + $scope.SetwindowStoreData(windowviewid, 'CurriculumTermData', []);
  8160 +
  8161 + // remove all in multi annotation in TP
  8162 + $('.dynCross_anno_' + windowviewid).parent().parent().parent().remove();
  8163 +
  8164 + // remove all in single annotation in TP
  8165 + $('.crossDiv_annotation_' + windowviewid).parent().parent().remove();
  8166 + $('#bord_annotation_' + windowviewid).remove();
  8167 + $('#dot_annotation_' + windowviewid).remove();
  8168 +
  8169 +
  8170 +
  8171 + // remove all in multi annotation
  8172 + $('.com_' + windowviewid).remove();
  8173 +
  8174 + // remove all in single annotation
  8175 + $('#dot_' + windowviewid).remove();
  8176 + $('#bord_' + windowviewid).remove();
  8177 + $('#crossDiv_' + windowviewid).parent().parent().remove();
  8178 + }
  8179 +
  8180 + //Added Method to Save TransparencyBox TermNumbers for SaveCB
  8181 + $scope.saveTermNumberForSaveCB = function (windowviewid,NormalTermNumber) {
  8182 + //Remove previous SpeechBubble with termnumber
  8183 +
  8184 + var preTermData = $scope.GetwindowStoreData(windowviewid, 'CurriculumTermData');
  8185 + if (preTermData != undefined && preTermData.length > 0) {
  8186 + for (var i = 0; i < preTermData.length; i++) {
  8187 + if (preTermData[i].termNumber != parseInt(NormalTermNumber)) {
  8188 +
  8189 + var CurriculumTermData = [];
  8190 + CurriculumTermData = $scope.GetwindowStoreData(windowviewid, 'CurriculumTermData');
  8191 + CurriculumTermData = new jinqJs()
  8192 + .from(CurriculumTermData)
  8193 + .delete().at("termNumber == " + preTermData[i].termNumber,'istpboxTerm == ' + 0).select();
  8194 +
  8195 + $scope.SetwindowStoreData(windowviewid, 'CurriculumTermData', CurriculumTermData);
  8196 + }
  8197 +
8295 8198 }
8296 8199 }
  8200 +
  8201 + // remove all in multi annotation
  8202 + $('.com_' + windowviewid).remove();
  8203 +
  8204 + // remove all in single annotation
  8205 + $('#dot_' + windowviewid).remove();
  8206 + $('#bord_' + windowviewid).remove();
  8207 + $('#crossDiv_' + windowviewid).parent().parent().remove();
  8208 +
8297 8209 }
8298 8210  
8299 8211 function clearTransCanvas(windowviewid) {
... ... @@ -8342,7 +8254,6 @@ AIA.controller(&quot;DAController&quot;, [&quot;$scope&quot;, &quot;$rootScope&quot;, &quot;$compile&quot;, &quot;$http&quot;, &quot;$l
8342 8254  
8343 8255 }
8344 8256 var RGBColor = (Red + Green + Blue);
8345   - $scope.NormalTermNumber = RGBColor;
8346 8257 $rootScope.annotationTextForTrans1 = [];
8347 8258 var annotationText1 = $scope.GetAnnotationText(parseInt(RGBColor),windowviewid);
8348 8259 var TermAnnotationText=$scope.GetwindowStoreData(windowviewid,'TermAnnotationText');
... ... @@ -8378,8 +8289,7 @@ AIA.controller(&quot;DAController&quot;, [&quot;$scope&quot;, &quot;$rootScope&quot;, &quot;$compile&quot;, &quot;$http&quot;, &quot;$l
8378 8289  
8379 8290 }
8380 8291 var RGBColorTrans = (RedTrans + GreenTrans + BlueTrans);
8381   - $scope.TBoxTermNumber = RGBColorTrans;
8382   -
  8292 +
8383 8293 $rootScope.annotationTextForTrans2 = [];
8384 8294 var annotationText2 = $scope.GetAnnotationText(parseInt(RGBColorTrans),windowviewid);
8385 8295 var TermAnnotationText=$scope.GetwindowStoreData(windowviewid,'TermAnnotationText');
... ... @@ -8389,7 +8299,9 @@ AIA.controller(&quot;DAController&quot;, [&quot;$scope&quot;, &quot;$rootScope&quot;, &quot;$compile&quot;, &quot;$http&quot;, &quot;$l
8389 8299  
8390 8300 return {
8391 8301 annotationT1: annotationText1,
8392   - annotationT2: annotationText2
  8302 + annotationT2: annotationText2,
  8303 + NormalTermNumber: RGBColor,
  8304 + TBoxTermNumber: RGBColorTrans
8393 8305 }
8394 8306 }
8395 8307  
... ... @@ -8475,17 +8387,13 @@ AIA.controller(&quot;DAController&quot;, [&quot;$scope&quot;, &quot;$rootScope&quot;, &quot;$compile&quot;, &quot;$http&quot;, &quot;$l
8475 8387 var modestyTransCanvasId = 'modestyTransCanavs_' + brId + "_" + windowviewid;
8476 8388 if (document.getElementById(modestyTransTempCanvasId) != null) {
8477 8389  
8478   -
  8390 + var modestyTransTempCanvas = document.getElementById(modestyTransTempCanvasId);
8479 8391 var tempCanvasContext = document.getElementById(modestyTransTempCanvasId).getContext('2d');
8480 8392 var originalTransparencyData = tempCanvasContext.getImageData(0, 0, value.Width, value.Height);
8481 8393 var ctx = document.getElementById(modestyTransCanvasId).getContext('2d');
8482 8394  
8483 8395 if ($scope.GetwindowStoreData(windowviewid, 'isHighLight') == true) {
8484   - //$timeout(function () {
8485   -
8486   - //var tempTransCanvas = document.getElementById(tempCanvasID);
8487   - //var tempCanvasContext = tempTransCanvas.getContext('2d');
8488   -
  8396 +
8489 8397 var dataURL = document.getElementById(modestyTransTempCanvasId).toDataURL();
8490 8398  
8491 8399 var img = new Image();
... ... @@ -8493,7 +8401,7 @@ AIA.controller(&quot;DAController&quot;, [&quot;$scope&quot;, &quot;$rootScope&quot;, &quot;$compile&quot;, &quot;$http&quot;, &quot;$l
8493 8401  
8494 8402 img.onload = function () {
8495 8403  
8496   - var DAData = new BitmapData(parseInt(document.getElementById(modestyTransTempCanvasId).width), parseInt(document.getElementById(modestyTransTempCanvasId).height));
  8404 + var DAData = new BitmapData(parseInt(modestyTransTempCanvas.width), parseInt(modestyTransTempCanvas.height));
8497 8405 DAData.draw(img);
8498 8406  
8499 8407 var colorMode = $scope.applyGrayMatrix(img, tempCanvasContext);
... ... @@ -8506,10 +8414,8 @@ AIA.controller(&quot;DAController&quot;, [&quot;$scope&quot;, &quot;$rootScope&quot;, &quot;$compile&quot;, &quot;$http&quot;, &quot;$l
8506 8414  
8507 8415 ctx.putImageData(DAData.data, 0, 0);
8508 8416  
8509   -
8510   -
8511 8417 //black issue
8512   - var imgData = ctx.getImageData(0, 0, document.getElementById(modestyTransTempCanvasId).document.getElementById(modestyTransTempCanvasId), transCanvas.height);
  8418 + var imgData = ctx.getImageData(0, 0, modestyTransTempCanvas.width,modestyTransTempCanvas.height);
8513 8419 var data = imgData.data;
8514 8420 var c = 0;
8515 8421 for (var i = 0; i < data.length; i += 4) {
... ... @@ -8567,18 +8473,8 @@ AIA.controller(&quot;DAController&quot;, [&quot;$scope&quot;, &quot;$rootScope&quot;, &quot;$compile&quot;, &quot;$http&quot;, &quot;$l
8567 8473 $("#btnExtract_" + windowviewid).removeClass("disabled");
8568 8474 $("#btnExtract_" + windowviewid).css("pointer-events", "auto");
8569 8475  
8570   - $scope.removeAllTermNumberForSaveCB(windowviewid);//Calling Methode for remove Annotations Text
8571   - $('.com_anno_'+windowviewid).remove();
8572   -
8573   - $('#sppeachBubble_annotation_'+windowviewid).remove();
8574   - $('#dot_annotation_'+windowviewid).remove();
8575   - $('#bord_annotation_'+windowviewid).remove();
8576   -
8577   - $('#dot_'+windowviewid).remove();
8578   - $('#sppeachBubble_' + windowviewid).remove();
8579   - $('.com_'+windowviewid).remove();
8580   - $('#bord_'+windowviewid).remove();
8581   -
  8476 + $scope.removeAllTermTpClose(windowviewid);
  8477 +
8582 8478 // clear canvas on closing of transparency box
8583 8479 if ($rootScope.isAnnotationWindowOpen == true) {
8584 8480 $('#canvasDA_'+windowviewid).removeLayers();
... ... @@ -8748,7 +8644,7 @@ AIA.controller(&quot;DAController&quot;, [&quot;$scope&quot;, &quot;$rootScope&quot;, &quot;$compile&quot;, &quot;$http&quot;, &quot;$l
8748 8644 $("#OnIdentify").removeClass("annotationtoolbartab");
8749 8645 $("#DrawMode").removeClass("annotationtoolbartab");
8750 8646 $('.btnCursor').removeClass('activebtncolor');
8751   - $(".annotationTollbar").css("display", "none");
  8647 + $("#annotationTollbar").css("display", "none");
8752 8648 $("#annotationButton").removeClass("active");
8753 8649 if ($scope.GetwindowStoreData(windowviewid,'isTransparencyBtnClicked') == true && !$scope.GetwindowStoreData(windowviewid,'isTransparencyActivated')) {
8754 8650 $("#btnExtract_" + windowviewid).addClass("disabled");
... ... @@ -8812,15 +8708,6 @@ AIA.controller(&quot;DAController&quot;, [&quot;$scope&quot;, &quot;$rootScope&quot;, &quot;$compile&quot;, &quot;$http&quot;, &quot;$l
8812 8708 $('#canvasDivDA_' + windowviewid).scrollLeft($('#canvasDivDA_'+windowviewid).width() / 2)
8813 8709 }
8814 8710  
8815   - //remove annotation speech bubble
8816   - if ($('#dot_'+windowviewid).length > 0) {
8817   - $('#dot_'+windowviewid).remove();
8818   - }
8819   -
8820   - if ($('#sppeachBubble_'+windowviewid).length > 0) {
8821   - $('#sppeachBubble_'+windowviewid).remove();
8822   - }
8823   -
8824 8711 $scope.removeAllTermNumberForSaveCB(windowviewid);
8825 8712 }
8826 8713  
... ... @@ -9057,29 +8944,6 @@ AIA.controller(&quot;DAController&quot;, [&quot;$scope&quot;, &quot;$rootScope&quot;, &quot;$compile&quot;, &quot;$http&quot;, &quot;$l
9057 8944 }
9058 8945 }
9059 8946  
9060   - // #7972 Mozilla Firefox> Incorrect navigation
9061   - $("#canvasDiv").scroll(function (event) {
9062   - var len= (event.currentTarget.id).split("_").length;
9063   - var windowviewid = (event.currentTarget.id).split("_")[len-1];
9064   -
9065   - var candivScrollleft=$('#canvasDivDA_' + windowviewid).scrollLeft();
9066   - var candivScrollTop=$('#canvasDivDA_' + windowviewid).scrollTop();
9067   -
9068   - // Fix Navigator position by CanvasDiv Scrolling
9069   - var can = $("#canvasDivDA_" + windowviewid);
9070   - var canheight = can[0].scrollHeight;
9071   - var canwidth = can[0].scrollWidth;
9072   -
9073   - var dragDivTop= (candivScrollTop/canheight)*($('#navigatorDiv_' + windowviewid).height());
9074   - var dragDivLeft= (candivScrollleft/canwidth)*($('#navigatorDiv_' + windowviewid).width());
9075   -
9076   - $("#draggable_" + windowviewid).css('top', dragDivTop);
9077   - $("#draggable_" + windowviewid).css('left', dragDivLeft>40?40:dragDivLeft);
9078   -
9079   - $scope.SetwindowStoreData(windowviewid,'CanvasDivLeftPosition',candivScrollleft);
9080   - $scope.SetwindowStoreData(windowviewid,'CanvasDivTopPosition',candivScrollTop);
9081   - });
9082   -
9083 8947 $scope.enableExtract = function (isCalledFromButton,windowviewid) {
9084 8948 $scope.SetwindowStoreData(windowviewid, 'mode', "EXTRACT");
9085 8949  
... ... @@ -9831,7 +9695,13 @@ AIA.controller(&quot;DAController&quot;, [&quot;$scope&quot;, &quot;$rootScope&quot;, &quot;$compile&quot;, &quot;$http&quot;, &quot;$l
9831 9695 $rootScope.CloseListManager();
9832 9696  
9833 9697 //Remove the Search list and then Repopulate it on change of Gender
9834   - $('#searchListDiv_' + windowviewid).empty()
  9698 + $('#searchListDiv_' + windowviewid).empty();
  9699 +
  9700 + var canDiv = document.getElementById('canvasDivDA_' + windowviewid);
  9701 + var canDivChildCount = canDiv.childElementCount;
  9702 + if (canDivChildCount > 0) {
  9703 + canDiv.innerHTML = '';
  9704 + }
9835 9705  
9836 9706 $scope.SetwindowStoreData(windowviewid,'isGenderChnage',true);
9837 9707  
... ... @@ -10343,9 +10213,6 @@ AIA.controller(&quot;DAController&quot;, [&quot;$scope&quot;, &quot;$rootScope&quot;, &quot;$compile&quot;, &quot;$http&quot;, &quot;$l
10343 10213 }
10344 10214  
10345 10215 $scope.mousePs;
10346   - function OnPaintCanvasClick(event) {
10347   -
10348   - }
10349 10216  
10350 10217 $scope.GetBodySystemData = function (currentBodyViewId,windowviewid) {
10351 10218 var bodySystemDataPath = '~/../content/data/json/da/body-views/' + currentBodyViewId + '/da_dat_body_system_term_' + currentBodyViewId + '.json';
... ... @@ -11283,8 +11150,6 @@ AIA.controller(&quot;DAController&quot;, [&quot;$scope&quot;, &quot;$rootScope&quot;, &quot;$compile&quot;, &quot;$http&quot;, &quot;$l
11283 11150  
11284 11151 var termsTotal = '<span class="pull-left marginTop5">' + VocabTermTxtfilter.length + ' Structures</span>';
11285 11152 $("#totalTerms").empty();
11286   - //$('#totalTerms').innerHTML = '';
11287   -
11288 11153 $('#totalTerms').append(termsTotal);
11289 11154 $scope.EnableUI();
11290 11155 }
... ... @@ -11423,7 +11288,6 @@ AIA.controller(&quot;DAController&quot;, [&quot;$scope&quot;, &quot;$rootScope&quot;, &quot;$compile&quot;, &quot;$http&quot;, &quot;$l
11423 11288  
11424 11289 var vocabTermDataArray = $scope.GetwindowStoreData(windowviewid, 'vocabTermDataArray')[lexiconInd].vocabTermTxt;
11425 11290  
11426   -
11427 11291 var searchvalue = $("#typedTermName_" + windowviewid).val();
11428 11292 var searchfilterdata = $filter('filter')(vocabTermDataArray, searchvalue);
11429 11293 $scope.limitTofilterdata = $filter('limitTo')(searchfilterdata, 10);
... ... @@ -11441,7 +11305,7 @@ AIA.controller(&quot;DAController&quot;, [&quot;$scope&quot;, &quot;$rootScope&quot;, &quot;$compile&quot;, &quot;$http&quot;, &quot;$l
11441 11305 var len= (event.currentTarget.id).split("_").length;
11442 11306 var windowviewid = (event.currentTarget.id).split("_")[len-1];
11443 11307  
11444   - $scope.EnableUI();
  11308 + $scope.DisableUI();
11445 11309 $('#searchedTermListPopUp_' + windowviewid).css({
11446 11310 'background': '#fff',
11447 11311 'border-radius': '3px',
... ... @@ -11452,7 +11316,7 @@ AIA.controller(&quot;DAController&quot;, [&quot;$scope&quot;, &quot;$rootScope&quot;, &quot;$compile&quot;, &quot;$http&quot;, &quot;$l
11452 11316 'width': '350px',
11453 11317 'position': 'absolute',
11454 11318 'top': '170px',
11455   - 'left': '140px',
  11319 + 'left': '40%',
11456 11320 'display': 'none',
11457 11321 'z-index': '780000',
11458 11322 'height': 'auto !important'
... ... @@ -11486,24 +11350,49 @@ AIA.controller(&quot;DAController&quot;, [&quot;$scope&quot;, &quot;$rootScope&quot;, &quot;$compile&quot;, &quot;$http&quot;, &quot;$l
11486 11350 $('#searchedTermListPopUp_' + windowviewid).css('display', 'block');
11487 11351 $('#searchedTermListPopUp_' + windowviewid).css("visibility", "visible");
11488 11352  
11489   - $('#searchedTermListPopUp_' + windowviewid).draggable();
  11353 + $('#searchedTermListPopUp_' + windowviewid).draggable({containment:'#daViewDA_' + windowviewid});
11490 11354  
11491   - $scope.FillSearchList(windowviewid);
  11355 + setTimeout(() => {
  11356 + $scope.FillSearchList(windowviewid);
  11357 + }, 100);
  11358 +
  11359 +
11492 11360 }
11493 11361 $scope.FillSearchList = function (windowviewid) {
11494 11362  
11495 11363 if ($('#searchTermListUl_' + windowviewid).html() != "") {
11496 11364 $('#searchTermListUl_' + windowviewid).empty();
11497 11365 }
11498   - $rootScope.a = $scope.GetwindowStoreData(windowviewid, 'primaryLexiconInd');
11499   - $scope.vocabArray=$scope.GetwindowStoreData(windowviewid,'vocabTermDataArray');
  11366 + var primaryLexiconIndex = $scope.GetwindowStoreData(windowviewid, 'primaryLexiconInd');
  11367 + var vocabTermDataArray=$scope.GetwindowStoreData(windowviewid,'vocabTermDataArray');
11500 11368  
11501   - $scope.sFilter = $("#typedTermName_" + windowviewid).val();
11502   - var $e2 = $('<li class="ng-scope" ng-repeat="item in vocabArray[a].vocabTermTxt| filter:{ _TermText: sFilter}">' +
11503   - '<a id="{{item._ActualTermNumber}}_'+windowviewid+'" href="" onclick="selectTerm(event)">{{item._TermText}}</a>' +
11504   - ' </li>').appendTo('#searchTermListUl_' + windowviewid)
11505   - $compile($e2)($scope);
  11369 + var searchvalue = $("#typedTermName_" + windowviewid).val();
  11370 + var searchfilterdata = $filter('filter')(vocabTermDataArray, searchvalue);
  11371 +
  11372 + var totalstructures=0;
  11373 + angular.forEach(searchfilterdata[primaryLexiconIndex].VocabTermData.VocabTerms.Term, function (value2, key2) {
  11374 + totalstructures=totalstructures+1;
  11375 + var $el = $('<option id=' + value2._ActualTermNumber +'_' +windowviewid+ '>' + value2._TermText + '</option>').appendTo('#searchTermListUl_' + windowviewid);
  11376 + $compile($el)($scope);
  11377 + })
  11378 + var termsTotal = '<span class="pull-left marginTop5">' + totalstructures + ' Structures</span>';
  11379 + $("#totalTerms").empty();
  11380 + $('#totalTerms').append(termsTotal);
  11381 +
11506 11382 $scope.EnableUI();
  11383 +
  11384 + if (navigator.userAgent.match(/(iPod|iPhone|iPad|android)/i)) {
  11385 +
  11386 + $(document).on("mouseover", "#searchTermListUl_" + windowviewid+ " option", function (e) {
  11387 + $('#searchedTermListPopUp_' + windowviewid).draggable('disable');
  11388 + });
  11389 + $(document).on("click", ".annotation-modal-header", function (e) {
  11390 +
  11391 + $('#searchedTermListPopUp_' + windowviewid).draggable('enable');
  11392 +
  11393 + });
  11394 + }
  11395 +
11507 11396 }
11508 11397 $scope.closeSerachTermListPopUp = function () {
11509 11398  
... ... @@ -11682,6 +11571,13 @@ function OnIdentifyClick() {
11682 11571 scope.IdentifyClick(windowviewid);
11683 11572 });
11684 11573 }
  11574 +function onDrawingCanvasTouch(event) {
  11575 + console.log('onDrawingCanvasTouch is called ');
  11576 + var scope = angular.element(document.getElementsByClassName("daBodyView")).scope();
  11577 + scope.$apply(function () {
  11578 + scope.onDrawingCanvasTouch(event);
  11579 + });
  11580 +}
11685 11581  
11686 11582 function OnZoom(event) {
11687 11583 var scope = angular.element(document.getElementsByClassName("daBodyView")).scope();
... ...
400-SOURCECODE/AIAHTML5.Web/app/controllers/HomeController.js
... ... @@ -2535,7 +2535,7 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data
2535 2535 }
2536 2536 }
2537 2537  
2538   -//reset option when load
  2538 + //reset option when load
2539 2539 $rootScope.resetMenuOption = function () {
2540 2540 $timeout(function () {
2541 2541 $rootScope.panelNameWithCb="";
... ... @@ -2732,47 +2732,38 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data
2732 2732 $rootScope.ShowAnnotationWindow = function () {
2733 2733  
2734 2734 var modulePanel = $("#HomeContainerDiv").find("div[id*='ImagePanel']");
2735   - if (modulePanel != undefined && modulePanel.length>0) {
  2735 + if (modulePanel != undefined && modulePanel.length>0) {
2736 2736 for (var index = 0 ; index < modulePanel.length; index++) {
2737 2737 var paneld = modulePanel[index].id;
2738 2738 if(paneld.match("daImagePanel")||paneld.match("AAImagePanel")||paneld.match("ciImagePanel")||paneld.match("aiImagePanel")||paneld.match("picImagePanel"))
2739 2739 {
2740 2740 var len = (paneld).split("_").length;
2741 2741 var MultiWinId = (paneld).split("_")[len - 1];
2742   - var PanelElement= $scope.GetPanelElement(paneld);
2743   -
2744   - var canvasElement = PanelElement.canvasElement;
2745   - if (canvasElement == undefined) continue;
2746   -
2747   - $scope.onDrawingCanvasOnModule(canvasElement);
2748   -
  2742 +
2749 2743 $rootScope.isAnnotatiomToolBarPopupActive = true;
2750 2744 $rootScope.isAnnotatiomToolBarPopupClosed = false;
2751 2745 $rootScope.isAnnotaionToolBarDrawingModeActive = false;
2752 2746  
2753   - if ($rootScope.disableAnnotationtoolOnListManager == true) {
2754   - $('#AnnotaionPopupDiv').find('a,input, textarea, button, select,img,div').attr('disabled', 'disabled');
2755   - $('#slider-range-min-2').slider('disable');
2756   - $("#annotationpaintbrushsize").attr('disabled', 'disabled');
2757   - $("#annotationpainteraser").attr('disabled', 'disabled');
2758   -
2759   - }
2760   - else {
2761   - $('#AnnotaionPopupDiv').find('input, textarea, button, select,img,div').removeAttr('disabled', 'disabled');
2762   - $('#slider-range-min-2').slider('enable');
2763   - $("#annotationpaintbrushsize").removeAttr('disabled', 'disabled');
2764   - $("#annotationpainteraser").removeAttr('disabled', 'disabled');
2765   - }
  2747 + if ($rootScope.disableAnnotationtoolOnListManager == true) {
  2748 + $('#AnnotaionPopupDiv').find('a,input, textarea, button, select,img,div').attr('disabled', 'disabled');
  2749 + $('#slider-range-min-2').slider('disable');
  2750 + $("#annotationpaintbrushsize").attr('disabled', 'disabled');
  2751 + $("#annotationpainteraser").attr('disabled', 'disabled');
  2752 +
  2753 + }
  2754 + else {
  2755 + $('#AnnotaionPopupDiv').find('input, textarea, button, select,img,div').removeAttr('disabled', 'disabled');
  2756 + $('#slider-range-min-2').slider('enable');
  2757 + $("#annotationpaintbrushsize").removeAttr('disabled', 'disabled');
  2758 + $("#annotationpainteraser").removeAttr('disabled', 'disabled');
  2759 + }
2766 2760  
2767   - // $("#annotationpaintbrushsize").attr("href", "#" + canvasPaintId);
2768   - // $("#annotationpainteraser").attr("href", "#" + canvasPaintId);
2769   - $("#annotationpainteraser").removeAttr('disabled', 'disabled');
  2761 + $("#annotationpainteraser").removeAttr('disabled', 'disabled');
2770 2762  
2771 2763 $("#OnIdentify").addClass("annotationtoolbartab");
2772 2764  
2773 2765 $rootScope.isAnnotationWindowOpen = true;
2774   - $(".annotationTollbar").css("display", "block");
2775   -
  2766 +
2776 2767 if(paneld.match("daImagePanel"))
2777 2768 {
2778 2769 $rootScope.daAnnotationToolEvent(MultiWinId);
... ... @@ -2825,11 +2816,22 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data
2825 2816 {
2826 2817 $rootScope.picAnnotationToolEvent(MultiWinId);
2827 2818 }
  2819 +
  2820 + // var PanelElement= $scope.GetPanelElement(paneld);
  2821 + // var canvasElement = PanelElement.canvasElement;
  2822 + // if (canvasElement == undefined) continue;
2828 2823  
  2824 + // $scope.onDrawingCanvasOnModule(canvasElement);
  2825 + // $scope.removeOnDrawingCanvas(canvasElement);
  2826 +
2829 2827 }
2830   - }
2831 2828 }
2832 2829  
  2830 + $("#annotationTollbar").modal('show');
  2831 + $(".modal-backdrop").css("z-index", "0");
  2832 +
  2833 + }
  2834 +
2833 2835  
2834 2836 var FontFamilyJson = '~/../content/data/json/settings/fontstyle.json';
2835 2837 if ($rootScope.isFontFamilyLoaded == false) {
... ... @@ -2865,7 +2867,8 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data
2865 2867 $("#DrawMode").removeClass("annotationtoolbartab");
2866 2868 $('.btnCursor').removeClass('activebtncolor');
2867 2869  
2868   - $(".annotationTollbar").css("display", "none");
  2870 + //$(".annotationTollbar").css("display", "none");
  2871 + $("#annotationTollbar").modal('hide');
2869 2872 $rootScope.isAnnotationWindowClose = true;
2870 2873 $('.btnCursor').removeClass('activebtncolor');
2871 2874 $(".btn-annotation").removeClass("activebtncolor");
... ... @@ -2885,8 +2888,7 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data
2885 2888 var PanelElement= $scope.GetPanelElement(paneld);
2886 2889 var canvasElement = PanelElement.canvasElement;
2887 2890 $scope.removeOnDrawingCanvas(canvasElement);
2888   -
2889   -
  2891 +
2890 2892 if (paneld.match("daImagePanel")) {
2891 2893 if ($("#transparencyScale_" + MultiWinId).css("display") == "block") {
2892 2894  
... ... @@ -2965,6 +2967,7 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data
2965 2967 }
2966 2968 }
2967 2969 $rootScope.CIAnotationIdentifyModeOff = false;
  2970 +
2968 2971 $rootScope.OnIdentifyClick = function () {
2969 2972 //clear sketch js event for paint and erase
2970 2973 $.sketch = { tools: {}};
... ... @@ -2995,7 +2998,7 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data
2995 2998 {
2996 2999 var len = (paneld).split("_").length;
2997 3000 var MultiWinId = (paneld).split("_")[len - 1];
2998   -
  3001 +
2999 3002 $rootScope.switchCanvas(paneld);
3000 3003  
3001 3004 if (paneld.match("daImagePanel")) {
... ... @@ -3062,6 +3065,12 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data
3062 3065 }
3063 3066  
3064 3067 }
  3068 +
  3069 + // remove event listener
  3070 + var PanelElement= $scope.GetPanelElement(paneld);
  3071 + var canvasElement = PanelElement.canvasElement;
  3072 + $scope.removeOnDrawingCanvas(canvasElement);
  3073 +
3065 3074 }
3066 3075 }
3067 3076 }
... ... @@ -3095,14 +3104,9 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data
3095 3104 var MaxZindexVal = Math.max(drawCanvasZindex, paintCanvasZindex, TransCanvasZindex);
3096 3105 MaxZindexVal = MaxZindexVal + 1;
3097 3106 $("#" + canvasId).css("z-index", MaxZindexVal);
3098   - if ($rootScope.currentBodyViewId == "11") {
3099   - $(".ui-wrapper").css("z-index", MaxZindexVal + 1);
3100   - $('#' + ctx.getAttribute("id")).css("z-index", MaxZindexVal);
3101   -
3102   - }
3103   - else {
3104   - $('#' + ctx.getAttribute("id")).css("z-index", MaxZindexVal);
3105   - }
  3107 + $(".ui-wrapper").css("z-index", MaxZindexVal + 1);
  3108 + $('#' + ctx.getAttribute("id")).css("z-index", MaxZindexVal);
  3109 +
3106 3110 }
3107 3111 else {
3108 3112 var drawCanvasZindex = $("#" + canvasId).css("z-index");
... ... @@ -3117,12 +3121,9 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data
3117 3121 else {
3118 3122  
3119 3123 $("#" + canvasId).css("z-index", MaxZindexVal);
3120   - if ($rootScope.currentBodyViewId == "11") {
3121   - $(".ui-wrapper").css("z-index", MaxZindexVal);
3122   - }
3123   - else {
3124   - $('#' + ctx.getAttribute("id")).css("z-index", MaxZindexVal);
3125   - }
  3124 + $(".ui-wrapper").css("z-index", MaxZindexVal);
  3125 + $('#' + ctx.getAttribute("id")).css("z-index", MaxZindexVal);
  3126 +
3126 3127  
3127 3128 }
3128 3129  
... ... @@ -3168,8 +3169,8 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data
3168 3169 }
3169 3170  
3170 3171 $rootScope.DrawingMode = function () {
3171   - //clear sketch js event for paint and erase
3172   - $.sketch = { tools: {}};
  3172 + //clear sketch js event for paint and erase
  3173 + $.sketch = { tools: {}};
3173 3174 //Annotation History
3174 3175 $rootScope.isAnnotaionToolBarDrawingModeActive = true;
3175 3176 $("#OnIdentify").removeClass("annotationtoolbartab");
... ... @@ -3184,7 +3185,7 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data
3184 3185 for (var index = 0 ; index < modulePanel.length; index++) {
3185 3186 var paneld = modulePanel[index].id;
3186 3187 if(paneld.match("daImagePanel")||paneld.match("AAImagePanel")||paneld.match("ciImagePanel")||paneld.match("aiImagePanel")||paneld.match("picImagePanel"))
3187   - {
  3188 + {
3188 3189 $rootScope.switchCanvas(paneld);
3189 3190 if(paneld.match("AAImagePanel"))
3190 3191 {
... ... @@ -3232,6 +3233,12 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data
3232 3233 }
3233 3234  
3234 3235 }
  3236 +
  3237 + // remove event listener
  3238 + var PanelElement= $scope.GetPanelElement(paneld);
  3239 + var canvasElement = PanelElement.canvasElement;
  3240 + $scope.removeOnDrawingCanvas(canvasElement);
  3241 +
3235 3242 }
3236 3243 }
3237 3244 }
... ... @@ -3240,7 +3247,7 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data
3240 3247  
3241 3248 // Dissectible Anatomy > Settings should be disable if Annotation is Open.
3242 3249 $rootScope.ShowSettingWindow = function () {
3243   - if ($(".annotationTollbar").css("display") == "block") {
  3250 + if ($("#annotationTollbar").css("display") == "block") {
3244 3251 $('#modal-settings').css("display", "none");
3245 3252 $("#modelsettingsbackground").css("display", "none");
3246 3253 }
... ... @@ -3280,7 +3287,7 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data
3280 3287 var canvasElement = PanelElement.canvasElement;
3281 3288 if (canvasElement == null || canvasElement == undefined) continue;
3282 3289 var canvasPaintElement = PanelElement.canvasPaintElement;
3283   -
  3290 +
3284 3291 var canvasId = canvasElement.id;
3285 3292 var canvasPaintId = canvasPaintElement.id;
3286 3293 $rootScope.setListManagerZindex = true;
... ... @@ -3311,7 +3318,9 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data
3311 3318 }
3312 3319  
3313 3320 }
3314   -
  3321 +
  3322 + $scope.onDrawingCanvasOnModule(canvasElement);
  3323 +
3315 3324 }
3316 3325 }
3317 3326 }
... ... @@ -3361,7 +3370,7 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data
3361 3370 var canvasElement = PanelElement.canvasElement;
3362 3371 if (canvasElement == null || canvasElement == undefined) continue;
3363 3372 var canvasPaintElement = PanelElement.canvasPaintElement;
3364   -
  3373 +
3365 3374 var canvasId = canvasElement.id;
3366 3375 var canvasPaintId = canvasPaintElement.id;
3367 3376 $("#" + canvasPaintId).css("display", "block");
... ... @@ -3392,10 +3401,13 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data
3392 3401 $('#summary_' + MultiWinId).css("z-index", canvasZIndex);
3393 3402 }
3394 3403  
3395   - }
  3404 + }
  3405 +
  3406 + $scope.onDrawingCanvasOnModule(canvasElement);
  3407 +
3396 3408 }
3397   - }
3398 3409 }
  3410 + }
3399 3411  
3400 3412 }
3401 3413  
... ... @@ -3439,6 +3451,11 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data
3439 3451 }
3440 3452  
3441 3453 }
  3454 +
  3455 + // remove event listener
  3456 + var PanelElement= $scope.GetPanelElement(paneld);
  3457 + var canvasElement = PanelElement.canvasElement;
  3458 + $scope.removeOnDrawingCanvas(canvasElement);
3442 3459 }
3443 3460 }
3444 3461 }
... ... @@ -3466,7 +3483,7 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data
3466 3483 var canvasElement = PanelElement.canvasElement;
3467 3484 if (canvasElement == null || canvasElement == undefined) continue;
3468 3485 var canvasPaintElement = PanelElement.canvasPaintElement;
3469   -
  3486 +
3470 3487 var canvasId = canvasElement.id;
3471 3488 var canvasPaintId = canvasPaintElement.id;
3472 3489 $rootScope.setListManagerZindex = true;
... ... @@ -3499,6 +3516,7 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data
3499 3516  
3500 3517 }
3501 3518  
  3519 + $scope.onDrawingCanvasOnModule(canvasElement);
3502 3520 }
3503 3521 }
3504 3522  
... ... @@ -3523,7 +3541,7 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data
3523 3541 var canvasElement = PanelElement.canvasElement;
3524 3542 if (canvasElement == null || canvasElement == undefined) continue;
3525 3543 var canvasPaintElement = PanelElement.canvasPaintElement;
3526   -
  3544 +
3527 3545 var canvasId = canvasElement.id;
3528 3546 var canvasPaintId = canvasPaintElement.id;
3529 3547 $rootScope.isAnnotaionToolBarDrawingModeActive = true;
... ... @@ -3595,12 +3613,14 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data
3595 3613 }
3596 3614  
3597 3615 }
  3616 + // remove event listener
  3617 + $scope.removeOnDrawingCanvas(canvasElement);
  3618 +
3598 3619 }
3599 3620 }
3600 3621 }
3601 3622  
3602 3623 $rootScope.EraseDrawing = function () {
3603   -
3604 3624 $('.btnCursor').removeClass('activebtncolor');
3605 3625 $(".btn-annotation").removeClass("activebtncolor");
3606 3626 $(".btn-annotation-erase").addClass("activebtncolor");
... ... @@ -3614,12 +3634,15 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data
3614 3634 if(paneld.match("daImagePanel")||paneld.match("AAImagePanel")||paneld.match("ciImagePanel")||paneld.match("aiImagePanel")||paneld.match("picImagePanel"))
3615 3635 {
3616 3636 var len = (paneld).split("_").length;
3617   - // var MultiWinId = (paneld).split("_")[len - 1];
  3637 + var MultiWinId = (paneld).split("_")[len - 1];
3618 3638 var PanelElement= $scope.GetPanelElement(paneld);
3619 3639  
3620   - var canvasPaintElement = PanelElement.canvasElement;
3621   - if (canvasPaintElement == null || canvasPaintElement == undefined) continue;
  3640 + var canvasElement = PanelElement.canvasElement;
  3641 + if (canvasElement == null || canvasElement == undefined) continue;
  3642 +
  3643 + var canvasPaintElement = PanelElement.canvasElement;
3622 3644 var canvasPaintId = canvasPaintElement.id;
  3645 +
3623 3646  
3624 3647 $rootScope.isAnnotaionToolBarDrawingModeActive = true;
3625 3648 $rootScope.switchCanvasToPaintCanvas(paneld);
... ... @@ -3644,6 +3667,9 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data
3644 3667  
3645 3668 $("#annotationpainteraser").attr("data-size", parseInt($("#btnBrushSize").val()));
3646 3669 $scope.PaintEraseEvent();
  3670 +
  3671 + // remove event listener
  3672 + $scope.removeOnDrawingCanvas(canvasElement);
3647 3673 }
3648 3674 }
3649 3675  
... ... @@ -3680,10 +3706,14 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data
3680 3706 case 'mouseup':
3681 3707 $rootScope.UnsaveCurriculum = true;
3682 3708 $scope.savePaintAnnotation(this.el.id,this.actions);
3683   -
3684   - case 'mouseout':
3685   - case 'mouseleave':
  3709 + this.stopPainting();
  3710 + break;
3686 3711 case 'touchend':
  3712 + $rootScope.UnsaveCurriculum = true;
  3713 + $scope.savePaintAnnotation(this.el.id,this.actions);
  3714 + break;
  3715 + case 'mouseout':
  3716 + case 'mouseleave':
3687 3717 case 'touchcancel':
3688 3718 this.stopPainting();
3689 3719 }
... ... @@ -3825,7 +3855,7 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data
3825 3855 var canvasElement = PanelElement.canvasElement;
3826 3856 if (canvasElement == null || canvasElement == undefined) continue;
3827 3857 var canvasPaintElement = PanelElement.canvasPaintElement;
3828   -
  3858 +
3829 3859 var canvasId = canvasElement.id;
3830 3860 var canvasPaintId = canvasPaintElement.id;
3831 3861 $rootScope.setListManagerZindex = true;
... ... @@ -3857,9 +3887,11 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data
3857 3887  
3858 3888 }
3859 3889  
  3890 + $scope.onDrawingCanvasOnModule(canvasElement);
  3891 +
3860 3892 }
3861   - }
3862   - }
  3893 + }
  3894 + }
3863 3895 }
3864 3896  
3865 3897 $rootScope.DrawArrow = function (e) {
... ... @@ -3884,7 +3916,7 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data
3884 3916 var canvasElement = PanelElement.canvasElement;
3885 3917 if (canvasElement == null || canvasElement == undefined) continue;
3886 3918 var canvasPaintElement = PanelElement.canvasPaintElement;
3887   -
  3919 +
3888 3920 var canvasId = canvasElement.id;
3889 3921 var canvasPaintId = canvasPaintElement.id;
3890 3922 $rootScope.setListManagerZindex = true;
... ... @@ -3916,9 +3948,11 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data
3916 3948  
3917 3949 }
3918 3950  
  3951 + $scope.onDrawingCanvasOnModule(canvasElement);
  3952 +
3919 3953 }
3920   - }
3921   - }
  3954 + }
  3955 + }
3922 3956 }
3923 3957 $rootScope.DrawText = function () {
3924 3958 //clear sketch js event for paint and erase
... ... @@ -3942,7 +3976,7 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data
3942 3976 var canvasElement = PanelElement.canvasElement;
3943 3977 if (canvasElement == null || canvasElement == undefined) continue;
3944 3978 var canvasPaintElement = PanelElement.canvasPaintElement;
3945   -
  3979 +
3946 3980 var canvasId = canvasElement.id;
3947 3981 var canvasPaintId = canvasPaintElement.id;
3948 3982 $rootScope.setListManagerZindex = true;
... ... @@ -3974,9 +4008,11 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data
3974 4008  
3975 4009 }
3976 4010  
  4011 + $scope.onDrawingCanvasOnModule(canvasElement);
  4012 +
3977 4013 }
3978   - }
3979   - }
  4014 + }
  4015 + }
3980 4016  
3981 4017 }
3982 4018  
... ... @@ -3999,7 +4035,7 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data
3999 4035 var canvasElement = PanelElement.canvasElement;
4000 4036 if (canvasElement == null || canvasElement == undefined) continue;
4001 4037 var canvasPaintElement = PanelElement.canvasPaintElement;
4002   -
  4038 +
4003 4039 var canvasId = canvasElement.id;
4004 4040 var canvasPaintId = canvasPaintElement.id;
4005 4041 $rootScope.setListManagerZindex = true;
... ... @@ -4031,9 +4067,11 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data
4031 4067  
4032 4068 }
4033 4069  
  4070 + $scope.onDrawingCanvasOnModule(canvasElement);
  4071 +
4034 4072 }
4035   - }
4036   - }
  4073 + }
  4074 + }
4037 4075  
4038 4076 }
4039 4077  
... ... @@ -4071,16 +4109,11 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data
4071 4109 else {
4072 4110  
4073 4111 if ($("#annotationpaintbrushsize").hasClass("activebtncolor") || $("#annotationpainteraser").hasClass("activebtncolor")) {
4074   - if ($rootScope.currentBodyViewId == "11") { $("#" + canvasPaintId).css("z-index", MaxZindexVal + 1); }
4075   - else { $("#" + canvasPaintId).css("z-index", MaxZindexVal); }
  4112 + $("#" + canvasPaintId).css("z-index", MaxZindexVal + 1);
4076 4113 }
4077   - else {
4078   - if ($rootScope.currentBodyViewId == "11") {
4079   - $("#" + canvasId).css("z-index", MaxZindexVal + 1);
4080   - }
4081   - else {
4082   - $("#" + canvasId).css("z-index", MaxZindexVal);
4083   - }
  4114 + else
  4115 + {
  4116 + $("#" + canvasId).css("z-index", MaxZindexVal + 1);
4084 4117 }
4085 4118  
4086 4119 }
... ... @@ -4170,6 +4203,9 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data
4170 4203 var paneld = modulePanel[index].id;
4171 4204 if(paneld.match("daImagePanel")||paneld.match("AAImagePanel")||paneld.match("ciImagePanel")||paneld.match("aiImagePanel")||paneld.match("picImagePanel"))
4172 4205 {
  4206 + var len = (paneld).split("_").length;
  4207 + var MultiWinId = (paneld).split("_")[len - 1];
  4208 +
4173 4209 if ($("#annotationpaintbrushsize").hasClass('activebtncolor')) {
4174 4210 $("#annotationpaintbrushsize").removeClass('activebtncolor')
4175 4211 $rootScope.switchCanvas(paneld);
... ... @@ -4235,6 +4271,23 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data
4235 4271 }
4236 4272 }
4237 4273  
  4274 + $rootScope.changeWidthManager = function () {
  4275 + var borderWidth = 2;
  4276 + var borderColor = "#000";
  4277 + borderWidth = $("#borderWidthCanvasElement option:selected").val();
  4278 + $rootScope.shapestyleborderWidth = Math.round(borderWidth);
  4279 + borderColor = $('#outlineColor .minicolors >.minicolors-swatch > .minicolors-swatch-color').css("background-color");
  4280 +
  4281 + if (borderColor != null) {
  4282 + document.getElementById("imgOpacity").parentNode.style.border = borderWidth + "px" + " " + "solid" + " " + borderColor;
  4283 + //$("#imgOpacity").parent().css("border", borderWidth + "px" + " " + "solid" + borderColor);
  4284 + } else {
  4285 +
  4286 + // $("#imgOpacity").parent().css("border", borderWidth + "px" + " " + "solid");
  4287 + document.getElementById("imgOpacity").parentNode.style.border = borderWidth + "px" + " " + "solid" + " " + borderColor;
  4288 +
  4289 + }
  4290 + }
4238 4291 $rootScope.enableAnnotationToolBar = function () {
4239 4292 if ($rootScope.disableAnnotationTB == true) {
4240 4293 document.getElementById('modelbackground').style.display = "none";
... ... @@ -5174,6 +5227,7 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data
5174 5227 $('.btnCursor').trigger('click');
5175 5228 $(".btn-annotation").removeClass("activebtncolor");
5176 5229 $('.btnCursor').addClass('activebtncolor');
  5230 +
5177 5231 }
5178 5232  
5179 5233 $rootScope.DrawPinOnModuleItem = function (canvasId, PinNumber,shapestyleborderColor, shapestyleborderWidth, offsetX1, offsetY1, x, y) {
... ... @@ -6097,12 +6151,13 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data
6097 6151  
6098 6152 window.addEventListener('mouseup', $rootScope.OnPaintCanvasMouseUp);
6099 6153 window.addEventListener("touchend", $rootScope.OnPaintCanvasMouseUp);
6100   -
  6154 +
6101 6155 }
6102 6156  
6103 6157 }
6104 6158 $scope.removeOnDrawingCanvas = function (annotationCanvas) {
6105 6159  
  6160 + if (annotationCanvas != null || annotationCanvas != undefined) {
6106 6161 //remove old event listener
6107 6162 //event code modified .work of only DA,AA,CI,AI,PIC
6108 6163 annotationCanvas.removeEventListener("mousedown", $rootScope.OnPaintCanvasMouseDown);
... ... @@ -6111,7 +6166,8 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data
6111 6166 annotationCanvas.removeEventListener("touchend", $rootScope.OnPaintCanvasMouseUp);
6112 6167 window.removeEventListener('mouseup', $rootScope.OnPaintCanvasMouseUp);
6113 6168 window.removeEventListener("touchend", $rootScope.OnPaintCanvasMouseUp);
6114   -
  6169 +
  6170 + }
6115 6171  
6116 6172 }
6117 6173  
... ... @@ -6143,19 +6199,25 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data
6143 6199 var horizontlScrollPosition = canvasDiv.scrollLeft;
6144 6200 var $ua = navigator.userAgent;
6145 6201 if (($ua.match(/(iPod|iPhone|iPad|android)/i))) {
6146   - var verticalScrollPosition = canvasDiv.scrollTop;
6147   - var horizontlScrollPosition = canvasDiv.scrollLeft;
6148   - $rootScope.offsetX1 = event.pageX + horizontlScrollPosition - $('#' + canvasDivId).offset().left;
6149   - $rootScope.offsetY1 = event.pageY + verticalScrollPosition - $('#' + canvasDivId).offset().top;
  6202 + if(event.type == 'touchstart' || event.type == 'touchmove' || event.type == 'touchend' || event.type == 'touchcancel'){
  6203 + // var touch = e.originalEvent.touches[0] || e.originalEvent.changedTouches[0];
  6204 + var touch = event.touches[0] || event.changedTouches[0];
  6205 + var verticalScrollPosition = canvasDiv.scrollTop;
  6206 + var horizontlScrollPosition = canvasDiv.scrollLeft;
  6207 + $rootScope.offsetX1 = touch.pageX + horizontlScrollPosition - $('#' + canvasDivId).offset().left;
  6208 + $rootScope.offsetY1 = touch.pageY + verticalScrollPosition - $('#' + canvasDivId).offset().top;
  6209 + }
  6210 +
6150 6211 }
6151   - else {
  6212 + else
  6213 + {
6152 6214 $rootScope.offsetX1 = event.offsetX;
6153 6215 $rootScope.offsetY1 = event.offsetY;
6154 6216 }
6155 6217 // ctx.clearRect(0, 0, 2277, 3248);
6156 6218  
6157   - canvasElement.addEventListener('mousemove', $rootScope.OnPaintCanvasMouseMove);
6158   - canvasElement.addEventListener("touchmove", $rootScope.OnPaintCanvasMouseMove);
  6219 + canvasElement.addEventListener('mousemove', $rootScope.OnPaintCanvasMouseMove,false);
  6220 + canvasElement.addEventListener("touchmove", $rootScope.OnPaintCanvasMouseMove,false);
6159 6221 }
6160 6222 }
6161 6223 }
... ... @@ -6206,9 +6268,21 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data
6206 6268  
6207 6269 var verticalScrollPosition = canvasDiv.scrollTop;
6208 6270 var horizontlScrollPosition = canvasDiv.scrollLeft;
6209   - $rootScope.x =Math.round(event.pageX + horizontlScrollPosition - $('#' + canvasDivId).offset().left);
6210   - $rootScope.y =Math.round(event.pageY + verticalScrollPosition - $('#' + canvasDivId).offset().top);
6211   -
  6271 + var $ua = navigator.userAgent;
  6272 + if (($ua.match(/(iPod|iPhone|iPad|android)/i))) {
  6273 + if(event.type == 'touchstart' || event.type == 'touchmove' || event.type == 'touchend' || event.type == 'touchcancel'){
  6274 + // var touch = e.originalEvent.touches[0] || e.originalEvent.changedTouches[0];
  6275 + var touch = event.touches[0] || event.changedTouches[0];
  6276 + $rootScope.x = touch.pageX + horizontlScrollPosition - $('#' + canvasDivId).offset().left;
  6277 + $rootScope.y = touch.pageY + verticalScrollPosition - $('#' + canvasDivId).offset().top;
  6278 + }
  6279 + }
  6280 + else
  6281 + {
  6282 + $rootScope.x =Math.round(event.pageX + horizontlScrollPosition - $('#' + canvasDivId).offset().left);
  6283 + $rootScope.y =Math.round(event.pageY + verticalScrollPosition - $('#' + canvasDivId).offset().top);
  6284 + }
  6285 +
6212 6286 if($rootScope.shapeType=="Rectangle"|| $rootScope.shapeType=="Circle"|| $rootScope.shapeType=="TextArea")
6213 6287 {
6214 6288 //birendra
... ... @@ -6235,7 +6309,7 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data
6235 6309 }
6236 6310  
6237 6311 }
6238   -
  6312 +
6239 6313 // var ctx = canvasElement.getContext("2d");
6240 6314 // var PaintCanvasctx = canvasPaintElement.getContext("2d");
6241 6315 // activate for unsave curriculum
... ... @@ -6323,8 +6397,21 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data
6323 6397 currentCanvasId=canvasId;
6324 6398 var verticalScrollPosition = canvasDiv.scrollTop;
6325 6399 var horizontlScrollPosition = canvasDiv.scrollLeft;
6326   - $rootScope.MouseMoveXAxis = event.pageX + horizontlScrollPosition - $('#' + canvasDivId).offset().left;
6327   - $rootScope.MouseMoveYAxis = event.pageY + verticalScrollPosition - $('#' + canvasDivId).offset().top;
  6400 + var $ua = navigator.userAgent;
  6401 + if (($ua.match(/(iPod|iPhone|iPad|android)/i))) {
  6402 + if(event.type == 'touchstart' || event.type == 'touchmove' || event.type == 'touchend' || event.type == 'touchcancel'){
  6403 + // var touch = e.originalEvent.touches[0] || e.originalEvent.changedTouches[0];
  6404 + var touch = event.touches[0] || event.changedTouches[0];
  6405 + $rootScope.MouseMoveXAxis = touch.pageX + horizontlScrollPosition - $('#' + canvasDivId).offset().left;
  6406 + $rootScope.MouseMoveYAxis = touch.pageY + verticalScrollPosition - $('#' + canvasDivId).offset().top;
  6407 + }
  6408 +
  6409 + }
  6410 + else
  6411 + {
  6412 + $rootScope.MouseMoveXAxis = event.pageX + horizontlScrollPosition - $('#' + canvasDivId).offset().left;
  6413 + $rootScope.MouseMoveYAxis = event.pageY + verticalScrollPosition - $('#' + canvasDivId).offset().top;
  6414 + }
6328 6415  
6329 6416 switch ($rootScope.shapeType) {
6330 6417 case "Line":
... ... @@ -6455,7 +6542,6 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data
6455 6542  
6456 6543  
6457 6544 $rootScope.onDrawingCanvasClick = function (event) {
6458   -
6459 6545 if (event != undefined && (event.target.id).match("canvasDA")) {
6460 6546  
6461 6547 if ($rootScope.isAnnotaionToolBarDrawingModeActive == false) {
... ... @@ -6693,8 +6779,7 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data
6693 6779  
6694 6780 $('#listManager').css('display', 'block');
6695 6781 $("#listManager").css("visibility", "visible");
6696   - $('#listManager').draggable();
6697   -
  6782 +
6698 6783 // register event for search list manager
6699 6784 $(document).on("mouseover", "#termList option", function (e) {
6700 6785 $('#termList option[selected="selected"]').attr("selected", false);
... ... @@ -6775,14 +6860,12 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data
6775 6860  
6776 6861 if(selectedPanel.match("daImagePanel"))
6777 6862 {
6778   - // $rootScope.$broadcast('dalistManagerEvent', windowviewid);
6779 6863 $rootScope.dalistManagerEvent(windowviewid);
6780 6864  
6781 6865 $("#termList").attr("onclick", "if (typeof(this.selectedIndex) != 'undefined') onListManagerTermSelection(this.options[this.selectedIndex].id, true)");
6782 6866 }
6783 6867 else if(selectedPanel.match("AAImagePanel"))
6784 6868 {
6785   - // $rootScope.$broadcast('aalistManagerEvent', windowviewid);
6786 6869 $rootScope.aalistManagerEvent(windowviewid);
6787 6870  
6788 6871 $("#termList").attr("onclick", "if (typeof(this.selectedIndex) != 'undefined') onSearchItemSelection(this.options[this.selectedIndex].id)");
... ... @@ -6825,8 +6908,6 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data
6825 6908 console.log('listManager closed');
6826 6909 $rootScope.disableAnnotationtoolOnListManager = false;
6827 6910 if (paneld.match("daImagePanel") || paneld.match("AAImagePanel")) {
6828   - // $("#annotationpaintbrushsize").attr("href", "#" + canvasPaintId);
6829   - // $("#annotationpainteraser").attr("href", "#" + canvasPaintId);
6830 6911 if ($rootScope.disableAnnotationtoolOnListManager == false) {
6831 6912 $('#AnnotaionPopupDiv').find('a,input, textarea, button, select,img,div').removeAttr('disabled', 'disabled');
6832 6913 $('#slider-range-min-2').slider('enable');
... ... @@ -6834,7 +6915,7 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data
6834 6915 $("#annotationpainteraser").removeAttr('disabled', 'disabled');
6835 6916 $("#annotationpaintbrushsize").css('pointer-events', 'auto');
6836 6917 $("#annotationpainteraser").css('pointer-events', 'auto');
6837   - if ($(".annotationTollbar").css("display") == "block") {
  6918 + if ($("#annotationTollbar").css("display") == "block") {
6838 6919 $rootScope.switchCanvasToPaintCanvas(paneld);
6839 6920 }
6840 6921 }
... ... @@ -6865,6 +6946,9 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data
6865 6946 //setrtings
6866 6947 $rootScope.SetSettingActiveTab = function (tabToSet) {
6867 6948 $rootScope.SettingsTab = tabToSet;
  6949 + if (navigator.userAgent.match(/(iPod|iPhone|iPad|android)/i)) {
  6950 + $("#modal-settings").draggable('disable');
  6951 + }
6868 6952 };
6869 6953  
6870 6954 $rootScope.loadsettings = function () {
... ... @@ -7322,13 +7406,7 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data
7322 7406  
7323 7407  
7324 7408 $timeout(function () {
7325   - var $ua = navigator.userAgent;
7326   - if (($ua.match(/(iPod|iPhone|iPad|android)/i))) {
7327   -
7328   - }
7329   - else {
7330   - SetFrameToPrint();
7331   - }
  7409 + SetFrameToPrint();
7332 7410 }, 500);
7333 7411  
7334 7412 };
... ... @@ -7367,14 +7445,8 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data
7367 7445 if(pageno==modulePanel.length-1)
7368 7446 {
7369 7447 $timeout(function () {
7370   -
7371   - var $ua = navigator.userAgent;
7372   - if (($ua.match(/(iPod|iPhone|iPad|android)/i))) {
7373   -
7374   - }
7375   - else {
7376   - SetFrameToPrint();
7377   - }
  7448 + // working for all device
  7449 + SetFrameToPrint();
7378 7450  
7379 7451 }, pageno * 400+500);
7380 7452  
... ... @@ -7388,29 +7460,7 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data
7388 7460  
7389 7461 function CollectPrintData(canvasDivId, pageno, panelTitle) {
7390 7462 // Birendra
7391   - // create page to store print image data
7392   - var $ua = navigator.userAgent;
7393   - if (($ua.match(/(iPod|iPhone|iPad|android)/i))) {
7394   - $("#" + canvasDivId).append("<img id='exportlogo' class='img-responsive' src='content/images/adam-logo-small.png'/>");
7395   - html2canvas($("#" + canvasDivId), {
7396   - onrendered: function (canvas) {
7397   - var newWindow = window.open('');
7398   - newWindow.document.body.appendChild(canvas);
7399   - newWindow.focus();
7400   - newWindow.print();
7401   - $("#" + canvasDivId).children('#exportlogo').remove();
7402   - newWindow.close();
7403   -
7404   - //***** old code ********/
7405   - // var imgsrc = canvas.toDataURL("image/png");
7406   - // var printContent = '<div id="img1"><img src="' + imgsrc + '" id="newimg1" style="margin:auto;top:0px;left:0px;right:0px;position:absolute;border:1px solid #ccc;" /></div>';
7407   - // var newPrintWindow = window.open();
7408   - // $(newPrintWindow.document.body).html(printContent);
7409   - // newPrintWindow.print();
7410   - }
7411   - });
7412   - }
7413   - else {
  7463 + // create page to store print image data for all devices
7414 7464 html2canvas($("#" + canvasDivId), {
7415 7465 onrendered: function (canvas) {
7416 7466 var dataURL = canvas.toDataURL("image/jpeg");
... ... @@ -7450,10 +7500,6 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data
7450 7500 }
7451 7501 });
7452 7502  
7453   -
7454   -
7455   - }
7456   -
7457 7503 }
7458 7504  
7459 7505  
... ... @@ -7518,10 +7564,11 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data
7518 7564 var curPosture = panelTitle;
7519 7565  
7520 7566 if (document.getElementById('jsPanel-1')) {
  7567 +
7521 7568 if (dataURL == "" || dataURL == undefined) {
7522 7569  
7523 7570 setTimeout(function () {
7524   - $("#btnPrint").attr("id", canvas.id);
  7571 + // $("#btnPrint").attr("id", canvas.id.replace("#",""));
7525 7572 document.getElementById('imgPortrait').setAttribute('src', dataURL);
7526 7573 document.getElementById('imgLandscape').setAttribute('src', dataURL);
7527 7574 document.getElementById('spnModulePor').innerHTML = curModule;
... ... @@ -7537,7 +7584,7 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data
7537 7584 }
7538 7585 else {
7539 7586 setTimeout(function () {
7540   - $("#btnPrint").attr("id", canvas.id);
  7587 + // $("#btnPrint").attr("id", canvas.id.replace("#",""));
7541 7588 document.getElementById('imgPortrait').setAttribute('src', dataURL);
7542 7589 document.getElementById('imgLandscape').setAttribute('src', dataURL);
7543 7590  
... ... @@ -7569,26 +7616,15 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data
7569 7616  
7570 7617 }
7571 7618 });
7572   - $timeout(function () {
7573   - var $ua = navigator.userAgent;
7574   - if (($ua.match(/(iPod|iPhone|iPad|android)/i))) {
7575   - var printContainerWidth = $("#printcontainer").css("width");
7576   - $("#printcontainer").css({ "width": "100%", "min-width": printContainerWidth });
7577   - var jspanelContainerWidth = $("#jsPanel-1 .jsPanel-content").css("width");
7578   - $("#jsPanel-1 .jsPanel-content").css({ "width": "100%", "min-width": jspanelContainerWidth });
7579   - $("#jsPanel-1").css("width", "100%");
7580   -
7581   - }
7582   - }, 500)
7583 7619 };
7584 7620  
7585 7621 $scope.printImagePreview = function (event) {
7586 7622  
7587   - PrintDivContentByID('printBoxPor', event.target.id);
  7623 + PrintDivContentByID('printBoxPor');
7588 7624  
7589 7625 }
7590 7626  
7591   - function PrintDivContentByID(id, canvasDivId) {
  7627 + function PrintDivContentByID(id) {
7592 7628 if (id == 'printBoxPor') {
7593 7629 $("#printPSOptions").val("100%");
7594 7630 ResizeImage(1);
... ... @@ -7597,22 +7633,6 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data
7597 7633 $(document).ready(function () {
7598 7634 contents = document.getElementById(id).innerHTML;
7599 7635 });
7600   -
7601   - // code for printng in ipads
7602   - var $ua = navigator.userAgent;
7603   - if (($ua.match(/(iPod|iPhone|iPad|android)/i))) {
7604   - $("#" + canvasDivId).append("<img id='exportlogo' class='img-responsive' src='content/images/adam-logo-small.png'/>");
7605   - html2canvas($("#" + canvasDivId), {
7606   - onrendered: function (canvas) {
7607   - var imgsrc = canvas.toDataURL("image/png");
7608   - var printContent = '<div id="img1"><img src="' + imgsrc + '" id="newimg1" style="margin:auto;top:0px;left:0px;right:0px;position:absolute;border:1px solid #ccc;" /></div>';
7609   - var newPrintWindow = window.open();
7610   - $(newPrintWindow.document.body).html(printContent);
7611   - newPrintWindow.print();
7612   - }
7613   - });
7614   - }
7615   - else {
7616 7636 var frame1 = $('<iframe />');
7617 7637 frame1[0].name = "frame1";
7618 7638 frame1.css({ "position": "absolute", "top": "-1000000px" });
... ... @@ -7634,8 +7654,7 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data
7634 7654 window.frames["frame1"].print();
7635 7655 frame1.remove();
7636 7656 }, 500);
7637   - }
7638   - console.log('close');
  7657 +
7639 7658 }
7640 7659  
7641 7660  
... ... @@ -7852,6 +7871,11 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data
7852 7871 RestrictListDiv.style.display = 'block';
7853 7872 $(".restrict-carret-icon").css({ "transform": "rotate(90deg)", "-moz-transform": "rotate(90deg)", "-webkit-transform": "rotate(90deg)", "-ms-transform": "rotate(90deg)" });
7854 7873  
  7874 + if (navigator.userAgent.match(/(iPod|iPhone|iPad|android)/i)) {
  7875 +
  7876 + $("#listManager").draggable('disable');
  7877 + }
  7878 +
7855 7879 }
7856 7880  
7857 7881 $rootScope.reDirectURLToAdmin = function () {
... ... @@ -7909,15 +7933,7 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data
7909 7933 $("#cursor-block").html();
7910 7934  
7911 7935 }
7912   - var $ue = navigator.userAgent;
7913   - if (($ue.match(/(iPod|iPhone|iPad|android)/i))) {
7914   -
7915   - $("#text_area").click(function () {
7916   - $("#annotationTextModal").draggable('disable');
7917   - }).blur(function () {
7918   - $("#annotationTextModal").draggable('enable');
7919   - });
7920   - }
  7936 +
7921 7937 $rootScope.CheckRefresh = function (e) {
7922 7938 //Checking if 'REFRESHED' or 'RELOADED'
7923 7939 if ((e.keyCode === 116) || (e.keyCode == 82 && e.ctrlKey))
... ...
400-SOURCECODE/AIAHTML5.Web/app/controllers/LabExercController.js
... ... @@ -524,11 +524,14 @@ function ($scope, $rootScope, pages, log, $http, $timeout, DataService, $filter,
524 524 //reset option list manager and annotation
525 525 //call when module loaded
526 526 $rootScope.resetMenuOption();
527   - // call from while open module in CB
528   - $("#labImagePanel_" + windowviewid).on('click', function (event) {
529   - var pnlName = event.currentTarget.id;
530   - $rootScope.resetMenuOptionOnClick(pnlName);
531   -
  527 +
  528 + //remove pre event
  529 + $("#labImagePanel_" + windowviewid).off("click touchstart");
  530 +
  531 + $("#labImagePanel_" + windowviewid).on('click touchstart', function (event) {
  532 + //after drawing annotation click not work on iPad/Android device
  533 + var pnlName = event.currentTarget.id;
  534 + $rootScope.resetMenuOptionOnClick(pnlName);
532 535 });
533 536 }
534 537  
... ...
400-SOURCECODE/AIAHTML5.Web/app/controllers/MyAnimationController.js
... ... @@ -442,11 +442,15 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout
442 442 //call when module loaded
443 443 $rootScope.resetMenuOption();
444 444 // call from while open module in CB
445   - $("#vidImagePanel_" + windowviewid).on('click', function (event) {
446   - var pnlName = event.currentTarget.id;
447   - $rootScope.resetMenuOptionOnClick(pnlName);
448   -
449   - });
  445 + //remove pre event
  446 + $("#vidImagePanel_" + windowviewid).off("click touchstart");
  447 +
  448 + $("#vidImagePanel_" + windowviewid).on('click touchstart', function (event) {
  449 + //after drawing annotation click not work on iPad/Android device
  450 + var pnlName = event.currentTarget.id;
  451 + $rootScope.resetMenuOptionOnClick(pnlName);
  452 + });
  453 +
450 454 }
451 455  
452 456 }]);
... ...
400-SOURCECODE/AIAHTML5.Web/app/controllers/MyPictureController.js
... ... @@ -278,10 +278,10 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout
278 278 theme: 'success',
279 279 currentController: 'MyPictureController',
280 280 parentSlug: $scope.GetPICwindowStoreData(windowviewid, 'parentSlugName'),
281   - content: '<div class="col-sm-12">'+
  281 + content: '<div>'+
282 282 ' <div class="container-fluid">'+
283 283 ' <div class="row">'+
284   - '<div class=" col-sm-12 img-thumbnail" style="overflow: scroll;" id="canvasDivPIC_' + windowviewid + '" ><canvas id="canvasPaintPIC_' + windowviewid + '" ng-click="FreeStylePaint($event)" width="2277" height="800" class="canvas-annotationStyle1" style="position: absolute;z-index:0;left:0px"></canvas><canvas id="canvasPIC_' + windowviewid + '" ng-click="onDrawingCanvasClick($event)" width="2277" height="800" class="canvas-annotationStyle" style="position: absolute; background-color: transparent;z-index:1;left:0px "></canvas>' +
  284 + '<div class="img-thumbnail" style="overflow: hidden;width:100%;position:relative" id="canvasDivPIC_' + windowviewid + '" ><canvas id="canvasPaintPIC_' + windowviewid + '" ng-click="FreeStylePaint($event)" width="2277" height="800" class="canvas-annotationStyle1" style="position: absolute;z-index:0;left:0px"></canvas><canvas id="canvasPIC_' + windowviewid + '" ng-click="onDrawingCanvasClick($event)" width="2277" height="800" class="canvas-annotationStyle" style="position: absolute; background-color: transparent;z-index:1;left:0px "></canvas>' +
285 285 '<img id="mypic_' + windowviewid + '" alt="" title="" style="left:0px;top:0px;position:absolute">' +
286 286 '</div>'+
287 287 '</div></div></div>',
... ... @@ -376,14 +376,18 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout
376 376  
377 377 var canvasDIvHeight = $('#picImagePanel_' + windowviewid+ " .jsPanel-content").height();
378 378  
379   - $('#canvasDivPIC_' + windowviewid).css('height', canvasDIvHeight);
  379 + $('#canvasDivPIC_' + windowviewid).css('height', canvasDIvHeight);
  380 + var canvas = document.getElementById("canvasPIC_" + windowviewid);
  381 + var canvasPaint = document.getElementById("canvasPaintPIC_" + windowviewid);
  382 +
  383 + canvas.height = canvasDIvHeight;
  384 + canvasPaint.height = canvasDIvHeight
  385 + canvas.width = screen.width;
  386 + canvasPaint.width = screen.width;
380 387  
381 388 var openedImage = document.getElementById('mypic_' + windowviewid );
382 389 openedImage.src = selectedpicture;
383 390 openedImage.onload = function () {
384   - //$("#mypic_"+windowviewid).css("width", this.width + "px");
385   - // $("#mypic_"+windowviewid).css("height", this.height + "px");
386   -
387 391 $scope.JsPanelclick(windowviewid);
388 392  
389 393 var annotationData= $scope.picOpenInOtherModules.annotationData;
... ... @@ -424,18 +428,20 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout
424 428 //call when module loaded
425 429 $rootScope.resetMenuOption();
426 430  
427   - // call from while open module in CB
428   - $("#picImagePanel_" + windowviewid).on('click', function (event) {
429   -
430   - var pnlName = event.currentTarget.id;
431   - $rootScope.resetMenuOptionOnClick(pnlName);
432   -
433   - // store image for export while click on panel
434   -
435   - var currentViewTitle = $scope.GetPICwindowStoreData(windowviewid, 'currentViewTitle');
436   - $rootScope.StoreTitleName(currentViewTitle);
437   - $rootScope.StoreOrgImageName(currentViewTitle);
  431 + //remove pre event
  432 + $("#picImagePanel_" + windowviewid).off("click touchstart");
  433 +
  434 + $("#picImagePanel_" + windowviewid).on('click touchstart', function (event) {
  435 + //after drawing annotation click not work on iPad/Android device
  436 + var pnlName = event.currentTarget.id;
  437 + $rootScope.resetMenuOptionOnClick(pnlName);
  438 + // store image for export while click on panel
  439 + var currentViewTitle = $scope.GetPICwindowStoreData(windowviewid, 'currentViewTitle');
  440 + $rootScope.StoreTitleName(currentViewTitle);
  441 + $rootScope.StoreOrgImageName(currentViewTitle);
  442 +
438 443 });
  444 +
439 445 }
440 446  
441 447 }])
442 448 \ No newline at end of file
... ...
400-SOURCECODE/AIAHTML5.Web/app/controllers/TileViewListController.js
... ... @@ -971,21 +971,24 @@ function ($scope, $window, $rootScope, $compile, $http, $log, $location, $timeou
971 971 $scope.JsPanelclick = function (windowviewid) {
972 972 //reset option list manager and annotation
973 973 //call when module loaded
974   - $rootScope.resetMenuOption();
975   - // call from while open module in CB
976   - $("#AAImagePanel_" + windowviewid).on('click', function (event) {
977   -
978   - var pnlName=event.currentTarget.id;
979   - $rootScope.resetMenuOptionOnClick(pnlName);
980   - var titlt = $("#AAImagePanel_" + windowviewid).childNodes;
981   -
982   - // store image for export while click on panel
983   -
984   - var currentViewTitle = $scope.GetAAwindowStoreData(windowviewid, 'currentViewTitle');
985   - var imageName = $scope.GetAAwindowStoreData(windowviewid, 'imageName');
986   - $rootScope.StoreTitleName(currentViewTitle);
987   - $rootScope.StoreOrgImageName(imageName);
  974 + $rootScope.resetMenuOption();
  975 + //remove pre event
  976 + $("#AAImagePanel_" + windowviewid).off("click touchstart");
  977 +
  978 + $("#AAImagePanel_" + windowviewid).on('click touchstart', function (event) {
  979 + //after drawing annotation click not work on iPad/Android device
  980 + var pnlName=event.currentTarget.id;
  981 + $rootScope.resetMenuOptionOnClick(pnlName);
  982 + var titlt = $("#AAImagePanel_" + windowviewid).childNodes;
  983 +
  984 + // store image for export while click on panel
  985 +
  986 + var currentViewTitle = $scope.GetAAwindowStoreData(windowviewid, 'currentViewTitle');
  987 + var imageName = $scope.GetAAwindowStoreData(windowviewid, 'imageName');
  988 + $rootScope.StoreTitleName(currentViewTitle);
  989 + $rootScope.StoreOrgImageName(imageName);
988 990 });
  991 +
989 992 }
990 993  
991 994 $scope.setPreClickBtnCss = function (windowviewid) {
... ...
400-SOURCECODE/AIAHTML5.Web/app/views/LabExerc/LabExerc-view.html
... ... @@ -19,4 +19,4 @@
19 19  
20 20  
21 21 </div>
22   -<script src="../../../libs/DragDropTouch.js"></script>
23 22 \ No newline at end of file
  23 +<!-- <script src="../../../libs/DragDropTouch.js"></script> -->
24 24 \ No newline at end of file
... ...
400-SOURCECODE/AIAHTML5.Web/app/views/aa/atlas-anatomy-detail.html
... ... @@ -67,10 +67,10 @@
67 67 <div class="tools pull-left" style="top:44px;">
68 68 <div class="toggle-icon toggleBar toggleHeadingButton" id="sideBarToggle" onclick="SideBarToggleAA(event)" data-toggle="tooltip" data-placement="top" title="Show/Hide Sidebar"></div>
69 69 <div class="sprit-icon">
70   - <div class="col-sm-6"><button onclick="hidePins(event)" id="hidePinBtn" style="background-position: 10px 5px;" class="btn btn-black btn-sm tooltip-custom" data-toggle="tooltip" data-placement="bottom" title="Hide Pins"></button> </div>
71   - <div class="col-sm-6"><button class="btn btn-black btn-sm pull-right tooltip-custom" id="selectedPin" style="background-position: 15px -24px;" onclick="showSelectedPins(event)" data-toggle="tooltip" data-placement="bottom" title="Show Selected Pins"></button></div>
72   - <div class="col-sm-6"><button class="btn btn-primary btn-sm marginTop5 tooltip-custom" id="allPinBtn" style="background-position: 12px -105px;" onclick="showAllPins(event)" data-toggle="tooltip" data-placement="bottom" title="Show All Pins in System(s)"></button></div>
73   - <div class="col-sm-6">
  70 + <div class="col-sm-6" style="width:50%;float:left"><button onclick="hidePins(event)" id="hidePinBtn" style="background-position: 10px 5px;" class="btn btn-black btn-sm tooltip-custom" data-toggle="tooltip" data-placement="bottom" title="Hide Pins"></button> </div>
  71 + <div class="col-sm-6" style="width:50%;float:left"><button class="btn btn-black btn-sm pull-right tooltip-custom" id="selectedPin" style="background-position: 15px -24px;" onclick="showSelectedPins(event)" data-toggle="tooltip" data-placement="bottom" title="Show Selected Pins"></button></div>
  72 + <div class="col-sm-6" style="width:50%;float:left"><button class="btn btn-primary btn-sm marginTop5 tooltip-custom" id="allPinBtn" style="background-position: 12px -105px;" onclick="showAllPins(event)" data-toggle="tooltip" data-placement="bottom" title="Show All Pins in System(s)"></button></div>
  73 + <div class="col-sm-6" style="width:50%;float:left">
74 74 <div class="custom-tooltip">Select System</div>
75 75 <button class="btn btn-black btn-sm pull-right marginTop5 dropdown-toggle" type="button" id="dropdownMenu221" style="background-position: 10px -49px;" onclick="systemChange(event)"></button>
76 76 <ul class="tool-dropdown-menu" id="bodySystemList" style="height:270px; overflow:auto;z-index: 100000">
... ... @@ -90,7 +90,7 @@
90 90 <li class="disabledSelectedSystem"><a id="12" href="#" title="Urinary" onclick="showSelectedSystemPins(event)">Urinary</a></li>
91 91 </ul>
92 92 </div>
93   - <div class="col-sm-12" >
  93 + <div class="col-sm-12" style="width:50%;float:left" >
94 94 <button onclick="showHideAnnotation(event)" class="btn btn-primary btn-sm marginTop5 btn-block" id="comment-box" name="showAnnotationText" style="background-position: 28px -73px;width:80px;" title="Show/Hide Structure Name Boxes"></button>
95 95 </div>
96 96 </div>
... ... @@ -101,7 +101,7 @@
101 101 </div>
102 102  
103 103 <div class="main2">
104   - <div class="col-sm-12 stickey-area">
  104 + <div class="stickey-area">
105 105 <div class="breadcrumb">
106 106 <div class="">
107 107 <div class="input-group col-sm-8 col-xs-7 col-md-10 pull-left">
... ... @@ -140,11 +140,11 @@
140 140 </div>
141 141 </div>
142 142 </div>
143   - <div class="col-sm-12">
  143 + <div>
144 144 <div class="container-fluid">
145 145 <div class="row">
146 146  
147   - <div class=" col-sm-12 img-thumbnail canvasDivClass" id="canvasDiv" style="overflow: scroll;">
  147 + <div class="img-thumbnail canvasDivClass" id="canvasDiv" style="overflow: scroll;width:100%;position:relative">
148 148 <canvas id="canvasPaint" ng-click="FreeStylePaint($event)" width="2277" height="725" class="canvas-annotationStyle1"></canvas>
149 149 <canvas id="canvas" width="2277" height="725" class="canvas-annotationStyle"></canvas>
150 150  
... ...
400-SOURCECODE/AIAHTML5.Web/app/views/da/da-body-view-list.html
... ... @@ -12,7 +12,7 @@
12 12 </ul>
13 13 <!-- Tab panes -->
14 14 <div class="tab-content">
15   - <div role="tabpanel" class="tab-pane active">
  15 + <div role="tabpanel" class="tab-pane active" style="margin-top: 35px;">
16 16 <div class="row" id="bodyViewList">
17 17  
18 18  
... ...
400-SOURCECODE/AIAHTML5.Web/app/views/da/da-view.html
... ... @@ -231,7 +231,7 @@
231 231 </div>
232 232  
233 233 <div class="main2">
234   - <div class="col-sm-12 stickey-area">
  234 + <div class="stickey-area">
235 235 <div class="breadcrumb ">
236 236 <div class="">
237 237 <div class="input-group col-sm-8 col-xs-7 col-md-10 pull-left" id="da-input">
... ... @@ -264,7 +264,7 @@
264 264 <img src="~/../content/images/DA/navigator-view.png" style="height:30px; width:50px" />
265 265 </button>
266 266  
267   - <div class="dropdown-menu" id="navigatorDiv" style="min-height: initial; min-width: initial;left:-12px; ">
  267 + <div class="dropdown-menu" id="navigatorDiv" style="min-height: initial; min-width: initial;left:-30px; ">
268 268 <div id="navDiv" align="center" style="min-width: initial; height: 119px; ">
269 269 <img id="navimg" alt="" />
270 270 <div id="draggable" class="draggable ui-widget-content dragdivposition draggable_navigator" ng-mouseup="ScrollCanvasDiv($event)">
... ... @@ -276,11 +276,11 @@
276 276 </div>
277 277 </div>
278 278 </div>
279   - <div class=" canavsParent col-sm-12 " id="cp">
  279 + <div class=" canavsParent" id="cp">
280 280 <div class="container-fluid">
281 281 <div class="row">
282 282 <input type="hidden" id="zoomValue" value="x" />
283   - <div id="canvasDiv" class="col-sm-12 img-thumbnail" align="center">
  283 + <div id="canvasDiv" class="img-thumbnail" style="width:100%;position:relative" align="center">
284 284  
285 285 </div>
286 286  
... ... @@ -318,25 +318,20 @@
318 318 </div>
319 319 <div class="modal-body">
320 320 <div class="row paddingTopBtm10">
321   - <div class="col-sm-12">
322   -
  321 + <div class="col-sm-12" style="top:3px">
323 322 <div style="">
324   -
325 323 <!--DA > List Manager > Multiple structure selection should not be available.-->
326   - <div class="form-group">
327   - <ul id="searchTermListUl" class="form-control dropdown-menu" style="height:200px;width:100%;overflow-y:scroll;position:absolute;display:block;z-index:60001;"></ul>
328   -
  324 + <div class="form-group">
  325 + <select id="searchTermListUl" class="form-control" size="10" onclick="if (typeof (this.selectedIndex) != 'undefined') selectTerm(event)" ></select>
329 326 </div>
330 327  
331 328 </div>
332 329 <div style="clear:both;"></div>
333   -
334 330 </div>
335 331 </div>
336 332  
337 333 </div>
338 334 <div class="modal-footer" id="totalTerms">
339   -
340 335 </div>
341 336 </div>
342 337  
... ...
400-SOURCECODE/AIAHTML5.Web/app/widget/TopMenu.html
1 1 ๏ปฟ<div class="collapse navbar-collapse" id="topMenuBar">
2   - <ul class="nav navbar-nav toperMenu-spaceleft">
3   - <li class="dropdown navbarDropdownItem disableFileMenu" id="fileMenuAnchor">
  2 + <ul class="nav navbar-nav toperMenu-spaceleft" style="float:left">
  3 + <li class="dropdown navbarDropdownItem disableFileMenu" id="fileMenuAnchor" style="float:left">
4 4 <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">File<span class="caret"></span></a>
5 5 <ul class="dropdown-menu">
6 6 <li id="openResourceId"><a href="#" ng-click="openResource()">Open Resources</a></li>
... ... @@ -24,9 +24,9 @@
24 24 </ul>
25 25 </li>
26 26 <!--#7904-->
27   - <li id="annotationButton" class="navbarItem disableMenuoption"><a href="#" data-toggle="modal" data-target=".bs-example-modal-sm" ng-click="ShowAnnotationWindow()">Annotation</a></li>
  27 + <li id="annotationButton" class="navbarItem disableMenuoption" style="float:left"><a href="#" data-toggle="modal" data-target=".bs-example-modal-sm" ng-click="ShowAnnotationWindow()">Annotation</a></li>
28 28  
29   - <li id="Menuoptionid" class="dropdown navbarDropdownItem disableMenuoption">
  29 + <li id="Menuoptionid" class="dropdown navbarDropdownItem disableMenuoption" style="float:left">
30 30 <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">Options<span class="caret"></span></a>
31 31 <ul class="dropdown-menu">
32 32 <li id="optionsListManagerTab"><a href="#" ng-click="ShowListManager()">List Manager</a></li>
... ... @@ -40,17 +40,17 @@
40 40  
41 41 </ul>
42 42 </li>
43   - <li class="dropdown navbarDropdownItem">
  43 + <li class="dropdown navbarDropdownItem" style="float:left">
44 44 <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">Help<span class="caret"></span></a>
45 45 <ul class="dropdown-menu" id="helplinkId">
46 46 </ul>
47 47 </li>
48 48 <!--redirecting to Admin-->
49   - <li class="navbarItem"><a ng-click="reDirectURLToAdmin()" ng-show="haveRoleAdmin" style="cursor: pointer;">Admin</a></li>
  49 + <li class="navbarItem" style="float:left"><a ng-click="reDirectURLToAdmin()" ng-show="haveRoleAdmin" style="cursor: pointer;">Admin</a></li>
50 50 </ul>
51   - <ul class="nav navbar-nav navbar-right">
  51 + <ul class="nav navbar-nav navbar-right" style="float: right;">
52 52 <li id="userNameoption" class="navbarItem" style="pointer-events:none ;"><a href="#">{{userName}}</a></li>
53   - <li class="hidden-xs marginR5 logOut" data-toggle="tooltip" data-placement="top" title="Logout"><a href="" ng-click="LogoutUser()"><i class="fa fa-power-off"></i></a></li>
  53 + <li data-toggle="tooltip" data-placement="top" title="Logout"><a href="" ng-click="LogoutUser()"><i class="fa fa-power-off"></i></a></li>
54 54 </ul>
55 55 <div id="imaginary_container" style="visibility:hidden">
56 56 <div class="input-group stylish-input-group paddTop5 hidden-sm">
... ...
400-SOURCECODE/AIAHTML5.Web/index.aspx
... ... @@ -314,7 +314,7 @@
314 314 <div class="container-fluid">
315 315 <!-- Brand and toggle get grouped for better mobile display -->
316 316 <div class="navbar-header">
317   - <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#topFixedNavbar1" aria-expanded="false">
  317 + <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#topMenuBar" aria-expanded="false">
318 318 <span class="sr-only">Toggle navigation</span><span class="icon-bar"></span><span class="icon-bar"></span><span class="icon-bar"></span>
319 319 </button>
320 320 <a class="frameLogo navbar-brand"><img src="content/images/logo-main.png" class="img-responsive" alt=""></a>
... ... @@ -621,14 +621,14 @@
621 621 <img id="img-spinner" src="content/images/common/loading.gif" alt="Loading">
622 622 </div>
623 623 <!--Annotation Modal-->
624   - <div class="annotationTollbar" style="width: 300px;position: fixed; top: 80px; right: 20px; display: none; z-index: 1200000;">
  624 + <div id="annotationTollbar" style="width: 305px;position: fixed; top: 80px; right: 20px; display: none; z-index: 1200000;">
625 625 <div class="annotationbar">
626 626 <div class="modal-content">
627   - <div class="modal-header annotation-modal-header">
  627 + <div class="modal-header annotation-modal-header" style="background-color: #f5f5f5;">
628 628 <button type="button" class="close" data-dismiss="modal" aria-label="Close" ng-click="CloseAnnotationTool()"><span aria-hidden="true">&times;</span></button>
629 629 <h4 class="modal-title" id="myModalLabel">Annotation</h4>
630 630 </div>
631   - <div class="modal-body" id="AnnotaionPopupDiv">
  631 + <div class="modal-body" id="AnnotaionPopupDiv">
632 632 <div class="row">
633 633 <div class="col-sm-12">
634 634 <h5>Mode</h5>
... ... @@ -645,7 +645,7 @@
645 645 </div>
646 646  
647 647 </div>
648   - <div class="col-sm-12">
  648 + <div class="col-sm-12">
649 649 <h5>Tools</h5>
650 650 <div class="well well-popup">
651 651 <div class="" aria-label="...">
... ... @@ -704,7 +704,7 @@
704 704 </div>
705 705  
706 706  
707   - <div class="pull-left pl-12" style="width:45%; margin-left:2%;margin-top:5px;">
  707 + <div class="pull-left pl-12" style="width:45%;margin-top:9px;">
708 708 <div id="slider-range-min-2" ng-mouseover="addToolTip(270, 170, 120, 'Brush Size')" ng-mouseleave="removeToolTipOnMouseOut()"></div>
709 709 </div>
710 710 <div class="clearfix"></div>
... ... @@ -880,7 +880,7 @@
880 880 <div class="form-group">
881 881 <label class="col-sm-4 control-label" for="inputPassword3">Area</label>
882 882 <div class="col-sm-8">
883   - <select class="form-control" disabled>
  883 + <select class="form-control" id="areaviewid" disabled>
884 884 <option value="1" selected="">Entire View</option>
885 885 </select>
886 886 </div>
... ... @@ -918,8 +918,9 @@
918 918  
919 919  
920 920 <!--Edit Shape Modal-->
  921 +
921 922  
922   - <div class="modeleditstyle" id="modeleditstyle" style="z-index: 1000000000; background: white;width: 302px;position:fixed;left:40%;right:0;top:70px;">
  923 + <div class="modeleditstyle" id="modeleditstyle" style="z-index: 1000000000; background: white;width: 302px;position:fixed;left:40%;right:0;top:70px;">
923 924 <div class="modal-content">
924 925 <div class="modal-header annotation-modal-header">
925 926 <h4 class="modal-title" id="myModalLabel33">Edit Shape Style</h4>
... ... @@ -937,13 +938,6 @@
937 938 </div>
938 939 </div>
939 940 <div class="col-sm-6 enableDisableOpacity">
940   - <!--<div class="radio">
941   - <label>
942   - <input type="radio" name="filloption" id="filloption1" value="filloption1">
943   - <span class="">Texture</span>
944   - <img id="editstyleTexture" src="~/../content/images/common/annotation-tool-bar/pattern-picker.png" alt="" class="pattern-picker" data-toggle="modal" data-target="#pattern">
945   - </label>
946   - </div>-->
947 941 <div class="radio">
948 942 <label>
949 943 <input type="radio" name="filloption" id="filloption2" value="filloption2" checked style="margin-top:8px;">
... ... @@ -1003,12 +997,12 @@
1003 997 </label>
1004 998 </div>
1005 999  
1006   - <div class="col-sm-6 setEnableDisableForEditShapeStyle">
  1000 + <div class="col-sm-6 setEnableDisableForEditShapeStyle">
1007 1001 <div class="form-horizontal">
1008 1002 <div class="form-group">
1009 1003 <label class="col-sm-3 control-label" style=" font-weight:normal; padding-top:9px;">Size</label>
1010 1004 <div class="col-sm-9 marginTop5">
1011   - <select id="borderWidthCanvasElement" class="form-control input-sm">
  1005 + <select id="borderWidthCanvasElement" onchange="changeWidthManager()" class="form-control input-sm">
1012 1006 <option value="1">1</option>
1013 1007 <option value="2" selected>2</option>
1014 1008 <option value="3">3</option>
... ... @@ -1664,6 +1658,7 @@
1664 1658 <script src="libs/html2canvas.js?v=1.0.0"></script>
1665 1659 <script src="libs/FileSaver.js"></script>
1666 1660 <script src="app/services/LabExerciseService.js?v=1.0.0"></script>
  1661 + <script src="libs/DragDropTouch.js"></script>
1667 1662 <!--<script type="text/javascript">
1668 1663 $(function () {
1669 1664 $('#canvas').sketch();
... ... @@ -1691,7 +1686,8 @@
1691 1686 <script>
1692 1687 $(function () {
1693 1688 $(".modal").draggable({ containment: 'window' });
1694   - $(".annotationTollbar").draggable({ containment: 'window' });
  1689 + $("#listManager").draggable({ containment: 'window' });
  1690 + $("#annotationTollbar").draggable({ containment: 'window' });
1695 1691 $(".modeleditstyle").draggable({containment:'window'});
1696 1692 $("#annotationTextModal").draggable({ containment: 'window' });
1697 1693 $("#modal-settings").draggable({ containment: 'window' });
... ... @@ -1713,7 +1709,6 @@
1713 1709 $("#text-left").addClass("ActiveFormattingButtonClass");
1714 1710 $("#text_area").css("text-align", "left");
1715 1711  
1716   -
1717 1712 });
1718 1713  
1719 1714  
... ... @@ -1726,14 +1721,12 @@
1726 1721 $("#text-center").addClass("ActiveFormattingButtonClass");
1727 1722 $("#text_area").css("text-align", "center");
1728 1723  
1729   -
1730 1724 });
1731 1725  
1732 1726  
1733 1727 $("#text-right").on('click', function () {
1734 1728  
1735 1729 //Annotation: Formatting buttons color is not change when select.
1736   -
1737 1730 $("#text-left").removeClass("ActiveFormattingButtonClass");
1738 1731 $("#text-center").removeClass("ActiveFormattingButtonClass");
1739 1732 $("#text-right").addClass("ActiveFormattingButtonClass");
... ... @@ -1807,25 +1800,7 @@
1807 1800 $(document).ready(function () {
1808 1801 // $("#font-color .minicolors .minicolors-swatch .minicolors-swatch-color").addClass("ActiveDefaultColorAnnotation");
1809 1802  
1810   - var borderWidth = 2;
1811   - var borderColor = "#000";
1812   - $("#borderWidthCanvasElement").change(function () {
1813   - borderWidth = $(this).val();
1814   - borderColor = $('#outlineColor .minicolors >.minicolors-swatch > .minicolors-swatch-color').css("background-color");
1815   -
1816   - if (borderColor != null) {
1817   - document.getElementById("imgOpacity").parentNode.style.border = borderWidth + "px" + " " + "solid" + " " + borderColor;
1818   - //$("#imgOpacity").parent().css("border", borderWidth + "px" + " " + "solid" + borderColor);
1819   - } else {
1820   -
1821   - // $("#imgOpacity").parent().css("border", borderWidth + "px" + " " + "solid");
1822   - document.getElementById("imgOpacity").parentNode.style.border = borderWidth + "px" + " " + "solid" + " " + borderColor;
1823   -
1824   - }
1825   - });
1826   -
1827   -
1828   -
  1803 +
1829 1804 $('.borderColorCanvasPreview').each(function () {
1830 1805 // $("#font-color .minicolors .minicolors-swatch .minicolors-swatch-color").addClass("ActiveDefaultColorAnnotation");
1831 1806 $(this).minicolors({
... ... @@ -2139,21 +2114,19 @@
2139 2114 }
2140 2115 </script>
2141 2116 <script>
2142   - if (navigator.userAgent.match(/Android/i)) {
2143   -
2144   - $("#bodySystems").click(function () {
  2117 + if (navigator.userAgent.match(/(iPod|iPhone|iPad|android)/i)) {
2145 2118  
2146   - $("#listManager").draggable('disable');
2147   -
2148   - }).blur(function () {
  2119 + $(document).on("click", ".annotation-modal-header", function (e) {
2149 2120  
2150 2121 $("#listManager").draggable('enable');
2151   -
  2122 + $("#modal-settings").draggable('enable');
2152 2123 });
2153 2124  
  2125 + $(document).on("mouseover", "#termList option", function (e) {
  2126 + $("#listManager").draggable('disable');
  2127 + });
2154 2128  
2155   -
2156   - $("#termList").click(function () {
  2129 + $("#viewName, #bodySystems, #areaviewid").click(function () {
2157 2130  
2158 2131 $("#listManager").draggable('disable');
2159 2132  
... ... @@ -2169,8 +2142,30 @@
2169 2142 }).blur(function () {
2170 2143 $("#modeleditstyle").draggable('enable');
2171 2144 });
  2145 +
  2146 +
  2147 + $("#selected-font-family, #selected-font-size").click(function () {
  2148 + $("#annotationTextModal").draggable('disable');
  2149 + }).blur(function () {
  2150 + $("#annotationTextModal").draggable('enable');
  2151 + });
  2152 + $("#lexiconLangDropdown").click(function () {
  2153 + $("#modal-settings").draggable('disable');
  2154 + }).blur(function () {
  2155 + $("#modal-settings").draggable('enable');
  2156 + });
  2157 +
  2158 +
2172 2159 }
2173 2160  
  2161 +
  2162 + function changeWidthManager()
  2163 + {
  2164 +
  2165 + angular.element(document.querySelector('[ng-controller="HomeController"]')).scope().changeWidthManager();
  2166 + }
  2167 +
  2168 +
2174 2169 function changeListManager() {
2175 2170  
2176 2171 angular.element(document.querySelector('[ng-controller="HomeController"]')).scope().changeListManager();
... ...
400-SOURCECODE/AIAHTML5.Web/libs/DragDropTouch.js
... ... @@ -147,13 +147,14 @@
147 147 }
148 148 });
149 149 // listen to touch events
150   - if ('ontouchstart' in document) {
  150 + // birendra: remove condition while change mode window to touch device
  151 + // if ('ontouchstart' in document) {
151 152 var d = document, ts = this._touchstart.bind(this), tm = this._touchmove.bind(this), te = this._touchend.bind(this), opt = supportsPassive ? { passive: false, capture: false } : false;
152 153 d.addEventListener('touchstart', ts, opt);
153 154 d.addEventListener('touchmove', tm, opt);
154 155 d.addEventListener('touchend', te);
155 156 d.addEventListener('touchcancel', te);
156   - }
  157 + // }
157 158 }
158 159 /**
159 160 * Gets a reference to the @see:DragDropTouch singleton.
... ...
400-SOURCECODE/AIAHTML5.Web/libs/sketch.js
... ... @@ -103,8 +103,11 @@ var __slice = Array.prototype.slice;
103 103 };
104 104 Sketch.prototype.onEvent = function(e) {
105 105 if (e.originalEvent && e.originalEvent.targetTouches) {
106   - e.pageX = e.originalEvent.targetTouches[0].pageX;
107   - e.pageY = e.originalEvent.targetTouches[0].pageY;
  106 + var touch = e.originalEvent.touches[0] || e.originalEvent.changedTouches[0];
  107 + e.pageX = touch.pageX;
  108 + e.pageY = touch.pageY;
  109 + //e.pageX = e.originalEvent.targetTouches[0].pageX;
  110 + //e.pageY = e.originalEvent.targetTouches[0].pageY;
108 111 }
109 112 if($.sketch.tools[$(this).data('sketch').tool]!=undefined) //Birendra-after paint/erase create problem while drawing other shape
110 113 {
... ...
400-SOURCECODE/AIAHTML5.Web/themes/default/css/bootstrap/3.3.6/bootstrap.css
... ... @@ -6047,7 +6047,7 @@ button.close {
6047 6047 }
6048 6048 }
6049 6049 /* update css for top menu for devices */
6050   -@media (min-width: 480px) and (max-width: 900px) {
  6050 +@media (min-width: 300px) and (max-width: 800px) {
6051 6051 #userNameoption {
6052 6052 display: none !important;
6053 6053 }
... ...
400-SOURCECODE/AIAHTML5.Web/themes/default/css/bootstrap/3.3.6/main.css
... ... @@ -713,7 +713,7 @@ select[multiple], select[size].multipleSelect{ height: 100%;}
713 713 font-size: inherit;
714 714 }
715 715 .pageHeading h4 {
716   - font-size: 20px;
  716 + font-size: 12px;
717 717 }
718 718 }
719 719  
... ...