Commit 81091eec3b97d7f9a2fc874700c9a68fea842fd1

Authored by Amrita Vishnoi
2 parents 2cb60e3b a36a7acc

Nikita's changes after conflict resolve on merge

400-SOURCECODE/AIAHTML5.Web/app/controllers/CAController.js
@@ -360,7 +360,7 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, pages, B @@ -360,7 +360,7 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, pages, B
360 360
361 $rootScope.openViews.push( 361 $rootScope.openViews.push(
362 { 362 {
363 - "module": $rootScope.currentActiveModuleTitle, "body-views": tittle, "state": 'max', "BodyViewId": $rootScope.currentBodyViewId, 363 + "module": $rootScope.currentActiveModuleTitle, "bodyView": tittle, "state": 'max', "BodyViewId": $rootScope.currentBodyViewId,
364 "slug": $rootScope.currentSlug 364 "slug": $rootScope.currentSlug
365 }); 365 });
366 366
400-SOURCECODE/AIAHTML5.Web/app/controllers/CIController.js
@@ -426,7 +426,7 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout @@ -426,7 +426,7 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout
426 426
427 $rootScope.openViews.push( 427 $rootScope.openViews.push(
428 { 428 {
429 - "module": $rootScope.currentActiveModuleTitle, "body-views": tittle, "state": 'max', "BodyViewId": $rootScope.currentBodyViewId, 429 + "module": $rootScope.currentActiveModuleTitle, "bodyView": tittle, "state": 'max', "BodyViewId": $rootScope.currentBodyViewId,
430 "slug": $rootScope.currentSlug 430 "slug": $rootScope.currentSlug
431 }); 431 });
432 432
400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js
@@ -165,7 +165,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo @@ -165,7 +165,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
165 //get the DA body view list based on selected gender 165 //get the DA body view list based on selected gender
166 $scope.getDAViewList = function ($event) { 166 $scope.getDAViewList = function ($event) {
167 167
168 - 168 + // debugger;
169 if ($('#MainImage') != null) { 169 if ($('#MainImage') != null) {
170 $('#MainImage').remove(); 170 $('#MainImage').remove();
171 } 171 }
@@ -244,7 +244,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo @@ -244,7 +244,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
244 } 244 }
245 245
246 $scope.imagePath = "~/../content/images/DA/" + $scope.zoomInOut + "/body-views/" + value._id + '/skintone/' + userEthnicity + '/' + thumbnailImage; 246 $scope.imagePath = "~/../content/images/DA/" + $scope.zoomInOut + "/body-views/" + value._id + '/skintone/' + userEthnicity + '/' + thumbnailImage;
247 - 247 + // debugger;
248 248
249 var $el = $('<div id=' + value._id + ' class="col-sm-3 col-lg-2" title = ' + value._title + ' data-ng-click="openView($event)"><div class="thumbnail" >' 249 var $el = $('<div id=' + value._id + ' class="col-sm-3 col-lg-2" title = ' + value._title + ' data-ng-click="openView($event)"><div class="thumbnail" >'
250 + '<img class= "daImg" id="' + value._title + '" src="' + $scope.imagePath + '" alt="" title="" >' 250 + '<img class= "daImg" id="' + value._title + '" src="' + $scope.imagePath + '" alt="" title="" >'
@@ -265,7 +265,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo @@ -265,7 +265,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
265 265
266 266
267 $scope.openView = function ($event) { 267 $scope.openView = function ($event) {
268 - 268 + // debugger;
269 $rootScope.isLoading = true; 269 $rootScope.isLoading = true;
270 $('#spinner').css('visibility', 'visible'); 270 $('#spinner').css('visibility', 'visible');
271 271
@@ -273,7 +273,6 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo @@ -273,7 +273,6 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
273 $rootScope.ViewTitle = $event.currentTarget.textContent; 273 $rootScope.ViewTitle = $event.currentTarget.textContent;
274 274
275 localStorage.setItem("currentViewTitleFromJson", $event.currentTarget.textContent); 275 localStorage.setItem("currentViewTitleFromJson", $event.currentTarget.textContent);
276 - localStorage.setItem("currentViewTitle", $event.currentTarget.textContent);  
277 localStorage.setItem("currentBodyViewId", $event.currentTarget.id); 276 localStorage.setItem("currentBodyViewId", $event.currentTarget.id);
278 277
279 var u = $location.url(); 278 var u = $location.url();
@@ -282,64 +281,6 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo @@ -282,64 +281,6 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
282 var view_list = angular.element($event.currentTarget); 281 var view_list = angular.element($event.currentTarget);
283 var view_list_male_female = view_list.attr('title'); 282 var view_list_male_female = view_list.attr('title');
284 283
285 - if (($event.currentTarget.textContent == "Female Anterior" || $event.currentTarget.textContent == "Male Anterior")) {  
286 - $rootScope.AnteriorView = "active";  
287 - $rootScope.LateralView = "";  
288 - $rootScope.MedialView = "";  
289 - $rootScope.PosteriorView = "";  
290 - $rootScope.LateralArmView = "";  
291 - $rootScope.MedialArmView = "";  
292 - }  
293 - if (($event.currentTarget.textContent == "Female Lateral" || $event.currentTarget.textContent == "Male Lateral")) {  
294 - $rootScope.AnteriorView = "";  
295 - $rootScope.LateralView = "active";  
296 - $rootScope.MedialView = "";  
297 - $rootScope.PosteriorView = "";  
298 - $rootScope.LateralArmView = "";  
299 - $rootScope.MedialArmView = "";  
300 -  
301 -  
302 - }  
303 - if (($event.currentTarget.textContent == "Female Medial" || $event.currentTarget.textContent == "Male Medial")) {  
304 - $rootScope.AnteriorView = "";  
305 - $rootScope.LateralView = "";  
306 - $rootScope.MedialView = "active";  
307 - $rootScope.PosteriorView = "";  
308 - $rootScope.LateralArmView = "";  
309 - $rootScope.MedialArmView = "";  
310 -  
311 -  
312 - }  
313 - if (($event.currentTarget.textContent == "Female Posterior" || $event.currentTarget.textContent == "Male Posterior")) {  
314 - $rootScope.AnteriorView = "";  
315 - $rootScope.LateralView = "";  
316 - $rootScope.MedialView = "";  
317 - $rootScope.PosteriorView = "active";  
318 - $rootScope.LateralArmView = "";  
319 - $rootScope.MedialArmView = "";  
320 -  
321 - }  
322 - if (($event.currentTarget.textContent == "Female Lateral Arm" || $event.currentTarget.textContent == "Male Lateral Arm")) {  
323 - $rootScope.AnteriorView = "";  
324 - $rootScope.LateralView = "";  
325 - $rootScope.MedialView = "";  
326 - $rootScope.PosteriorView = "";  
327 - $rootScope.LateralArmView = "active";  
328 - $rootScope.MedialArmView = "";  
329 -  
330 -  
331 - }  
332 - if (($event.currentTarget.textContent == "Female Medial Arm" || $event.currentTarget.textContent == "Male Medial Arm")) {  
333 - $rootScope.AnteriorView = "";  
334 - $rootScope.LateralView = "";  
335 - $rootScope.MedialView = "";  
336 - $rootScope.PosteriorView = "";  
337 - $rootScope.LateralArmView = "";  
338 - $rootScope.MedialArmView = "active";  
339 -  
340 -  
341 - }  
342 -  
343 //$rootScope.Normal = "LeftButtonsDefaultState"; 284 //$rootScope.Normal = "LeftButtonsDefaultState";
344 285
345 if (view_list_male_female == "Male") { 286 if (view_list_male_female == "Male") {
@@ -441,7 +382,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo @@ -441,7 +382,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
441 if (openViews != null && openViews != undefined) { 382 if (openViews != null && openViews != undefined) {
442 angular.forEach(openViews, function (value, key) { 383 angular.forEach(openViews, function (value, key) {
443 384
444 - if (value.body - views == tittle) { 385 + if (value.bodyView == tittle) {
445 tittle = localStorage.getItem("currentViewTitleFromJson") + counter++; 386 tittle = localStorage.getItem("currentViewTitleFromJson") + counter++;
446 $rootScope.currentActiveViewTitle = tittle; 387 $rootScope.currentActiveViewTitle = tittle;
447 localStorage.setItem("currentViewTitle", tittle); 388 localStorage.setItem("currentViewTitle", tittle);
@@ -480,7 +421,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo @@ -480,7 +421,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
480 //0.2 421 //0.2
481 $rootScope.openViews.push( 422 $rootScope.openViews.push(
482 { 423 {
483 - "module": $rootScope.currentActiveModuleTitle, "body-views": tittle, "state": 'max', "BodyViewId": $rootScope.currentBodyViewId, 424 + "module": $rootScope.currentActiveModuleTitle, "bodyView": tittle, "state": 'max', "BodyViewId": $rootScope.currentBodyViewId,
484 "slug": $rootScope.currentSlug 425 "slug": $rootScope.currentSlug
485 } 426 }
486 ); 427 );
@@ -682,7 +623,8 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo @@ -682,7 +623,8 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
682 623
683 624
684 $scope.LoadDefaultLayerImage = function () { 625 $scope.LoadDefaultLayerImage = function () {
685 - 626 + // debugger;
  627 +
686 $rootScope.isNormalMode = true; 628 $rootScope.isNormalMode = true;
687 629
688 $scope.layerNumber = 0; 630 $scope.layerNumber = 0;
@@ -943,9 +885,8 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo @@ -943,9 +885,8 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
943 var isiOSSafari = (navigator.userAgent.match(/iPad/i)) ? true : false; 885 var isiOSSafari = (navigator.userAgent.match(/iPad/i)) ? true : false;
944 886
945 //set scrollbars on canvas and hide loading label 887 //set scrollbars on canvas and hide loading label
946 - $('#daLoaderLabel').css('visibility', 'hidden') 888 + // $('#daLoaderLabel').css('visibility', 'hidden')
947 889
948 -  
949 $('#canvasDiv').css('overflow', 'scroll') 890 $('#canvasDiv').css('overflow', 'scroll')
950 if (isiOSSafari) { 891 if (isiOSSafari) {
951 $('#canvasDiv').scrollLeft($('#canvasDiv').width() + 150) 892 $('#canvasDiv').scrollLeft($('#canvasDiv').width() + 150)
@@ -954,8 +895,6 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo @@ -954,8 +895,6 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
954 else { 895 else {
955 $('#canvasDiv').scrollLeft($('#canvasDiv').width() / 2) 896 $('#canvasDiv').scrollLeft($('#canvasDiv').width() / 2)
956 } 897 }
957 -  
958 -  
959 // $('#canvasDiv').scrollLeft($scope.imageHorizontlScrollPosition) 898 // $('#canvasDiv').scrollLeft($scope.imageHorizontlScrollPosition)
960 $('#canvasDiv').scrollTop(50) 899 $('#canvasDiv').scrollTop(50)
961 var abc = $rootScope.BodyRegionCordinatesData; 900 var abc = $rootScope.BodyRegionCordinatesData;
@@ -996,8 +935,6 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo @@ -996,8 +935,6 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
996 }; 935 };
997 } 936 }
998 937
999 -  
1000 -  
1001 $('#draggable').css('width', dragdivw); 938 $('#draggable').css('width', dragdivw);
1002 $('#draggable').css('height', dragdivh) 939 $('#draggable').css('height', dragdivh)
1003 } 940 }
@@ -1059,7 +996,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo @@ -1059,7 +996,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
1059 996
1060 997
1061 $scope.GetImageSource = function (bodyRegionId) { 998 $scope.GetImageSource = function (bodyRegionId) {
1062 - 999 +
1063 var dataLength = $rootScope.BodyLayerData.Layers.DataLayer.length; 1000 var dataLength = $rootScope.BodyLayerData.Layers.DataLayer.length;
1064 1001
1065 //set max for LayerNumber input 1002 //set max for LayerNumber input
@@ -1077,7 +1014,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo @@ -1077,7 +1014,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
1077 1014
1078 $scope.userInput = parseInt($scope.layerNumber); 1015 $scope.userInput = parseInt($scope.layerNumber);
1079 1016
1080 - 1017 +
1081 $scope.skinTone = $rootScope.globalSetting.ethnicity; 1018 $scope.skinTone = $rootScope.globalSetting.ethnicity;
1082 1019
1083 var SelectedLayerData = []; 1020 var SelectedLayerData = [];
@@ -1139,7 +1076,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo @@ -1139,7 +1076,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
1139 } 1076 }
1140 1077
1141 $scope.GetBackgroundImgSource = function (bodyRegionId) { 1078 $scope.GetBackgroundImgSource = function (bodyRegionId) {
1142 - 1079 +
1143 1080
1144 var selectedGender; 1081 var selectedGender;
1145 if (localStorage.getItem("genderId") == "Male") { 1082 if (localStorage.getItem("genderId") == "Male") {
@@ -1157,7 +1094,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo @@ -1157,7 +1094,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
1157 if ($scope.bagartBodyRegionDetails != null || $scope.bagartBodyRegionDetails != undefined) { 1094 if ($scope.bagartBodyRegionDetails != null || $scope.bagartBodyRegionDetails != undefined) {
1158 1095
1159 //filter bodyRegion data basd on skintone 1096 //filter bodyRegion data basd on skintone
1160 - $scope.skinTone = $rootScope.globalSetting.ethnicity 1097 + $scope.skinTone = $rootScope.globalSetting.ethnicity
1161 $scope.bagartDetailsOnSktn = new jinqJs() 1098 $scope.bagartDetailsOnSktn = new jinqJs()
1162 .from($scope.bagartBodyRegionDetails) 1099 .from($scope.bagartBodyRegionDetails)
1163 .where('_Skintone == ' + $scope.skinTone) 1100 .where('_Skintone == ' + $scope.skinTone)
@@ -1421,7 +1358,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo @@ -1421,7 +1358,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
1421 1358
1422 if (isMaskImage == 'N') { 1359 if (isMaskImage == 'N') {
1423 1360
1424 - if ($scope.isLayerChangeByUpDownKey || $scope.isEnterPressed) { 1361 +
1425 $scope.ColoredImageSRC.push( 1362 $scope.ColoredImageSRC.push(
1426 { 1363 {
1427 "bodyRegionId": bodyRegionId, "SRC": src, 1364 "bodyRegionId": bodyRegionId, "SRC": src,
@@ -1432,7 +1369,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo @@ -1432,7 +1369,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
1432 "haveMirror": 'true' 1369 "haveMirror": 'true'
1433 } 1370 }
1434 ); 1371 );
1435 - } 1372 +
1436 1373
1437 // console.log('$rootScope.isListManagerSelected= ' + $rootScope.isListManagerSelected + ' length= ' + $scope.ColoredImageSRC.length) 1374 // console.log('$rootScope.isListManagerSelected= ' + $rootScope.isListManagerSelected + ' length= ' + $scope.ColoredImageSRC.length)
1438 1375
@@ -1455,12 +1392,11 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo @@ -1455,12 +1392,11 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
1455 $scope.isEligibleForHighlight = false; 1392 $scope.isEligibleForHighlight = false;
1456 } 1393 }
1457 1394
1458 - if ($scope.isEligibleForHighlight == true)  
1459 - { 1395 + if ($scope.isEligibleForHighlight == true) {
1460 if ($rootScope.isHighLight == true || ($rootScope.isListManagerSelected == true) || (($rootScope.isGenderChnage == true) && ($rootScope.isHighLight == true)) || (($rootScope.isViewChange == true) && ($rootScope.isHighLight == true))) { 1396 if ($rootScope.isHighLight == true || ($rootScope.isListManagerSelected == true) || (($rootScope.isGenderChnage == true) && ($rootScope.isHighLight == true)) || (($rootScope.isViewChange == true) && ($rootScope.isHighLight == true))) {
1461 1397
1462 - $rootScope.isLoading = false;  
1463 - $('#spinner').css('visibility', 'hidden'); 1398 + //$rootScope.isLoading = false;
  1399 + //$('#spinner').css('visibility', 'hidden');
1464 1400
1465 1401
1466 $rootScope.isLoading = true; 1402 $rootScope.isLoading = true;
@@ -1468,7 +1404,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo @@ -1468,7 +1404,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
1468 //$timeout(function () { 1404 //$timeout(function () {
1469 console.log('inside start of flipped. $scope.ColoredImageSRC.length= ' + $scope.ColoredImageSRC.length) 1405 console.log('inside start of flipped. $scope.ColoredImageSRC.length= ' + $scope.ColoredImageSRC.length)
1470 $rootScope.isHighLight = true; 1406 $rootScope.isHighLight = true;
1471 - console.log('in FlipedImgCanvas just before highLightBody call'); 1407 + console.log('just before highLightBody call');
1472 $scope.highLightBody(); 1408 $scope.highLightBody();
1473 console.log('just after highLightBody call'); 1409 console.log('just after highLightBody call');
1474 //}, 500); 1410 //}, 500);
@@ -1748,7 +1684,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo @@ -1748,7 +1684,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
1748 //do nothing 1684 //do nothing
1749 } 1685 }
1750 else { 1686 else {
1751 - if (($scope.isLayerChangeByUpDownKey) || ($scope.isEnterPressed)) { 1687 +
1752 $scope.ColoredImageSRC.push( 1688 $scope.ColoredImageSRC.push(
1753 { 1689 {
1754 "bodyRegionId": bodyRegionId, "SRC": src, 1690 "bodyRegionId": bodyRegionId, "SRC": src,
@@ -1760,7 +1696,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo @@ -1760,7 +1696,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
1760 } 1696 }
1761 1697
1762 ); 1698 );
1763 - } 1699 +
1764 1700
1765 if (($scope.ColoredImageSRC != null || $scope.ColoredImageSRC != undefined)) { 1701 if (($scope.ColoredImageSRC != null || $scope.ColoredImageSRC != undefined)) {
1766 1702
@@ -1780,9 +1716,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo @@ -1780,9 +1716,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
1780 $scope.isEligibleForHighlight = false; 1716 $scope.isEligibleForHighlight = false;
1781 } 1717 }
1782 1718
1783 - if ($scope.isEligibleForHighlight == true)  
1784 - {  
1785 - 1719 + if ($scope.isEligibleForHighlight == true) {
1786 if ($rootScope.isHighLight == true || ($rootScope.isListManagerSelected == true) || (($rootScope.isGenderChnage == true) && ($rootScope.isHighLight == true)) || (($rootScope.isViewChange == true) && ($rootScope.isHighLight == true))) { 1720 if ($rootScope.isHighLight == true || ($rootScope.isListManagerSelected == true) || (($rootScope.isGenderChnage == true) && ($rootScope.isHighLight == true)) || (($rootScope.isViewChange == true) && ($rootScope.isHighLight == true))) {
1787 1721
1788 $rootScope.isLoading = false; 1722 $rootScope.isLoading = false;
@@ -1794,11 +1728,8 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo @@ -1794,11 +1728,8 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
1794 //$timeout(function () { 1728 //$timeout(function () {
1795 console.log('inside start of non flipped. $scope.ColoredImageSRC.length= ' + $scope.ColoredImageSRC.length) 1729 console.log('inside start of non flipped. $scope.ColoredImageSRC.length= ' + $scope.ColoredImageSRC.length)
1796 $rootScope.isHighLight = true; 1730 $rootScope.isHighLight = true;
1797 -  
1798 console.log('just before highLightBody call'); 1731 console.log('just before highLightBody call');
1799 -  
1800 $scope.highLightBody(); 1732 $scope.highLightBody();
1801 -  
1802 console.log('just after highLightBody call'); 1733 console.log('just after highLightBody call');
1803 //}, 500); 1734 //}, 500);
1804 } 1735 }
@@ -1852,15 +1783,15 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo @@ -1852,15 +1783,15 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
1852 1783
1853 $scope.HighlightBodyOnExtract = function () { 1784 $scope.HighlightBodyOnExtract = function () {
1854 1785
1855 - 1786 +
1856 var multiTermList = []; 1787 var multiTermList = [];
1857 var CallBackBodyRegion = []; 1788 var CallBackBodyRegion = [];
1858 1789
1859 if ($rootScope.isListManagerSelected) { 1790 if ($rootScope.isListManagerSelected) {
1860 - 1791 +
1861 multiTermList = $scope.AllTerms; 1792 multiTermList = $scope.AllTerms;
1862 -  
1863 - } 1793 +
  1794 + }
1864 else if (($rootScope.previousHighlightList != null || $rootScope.previousHighlightList != undefined) && ($rootScope.previousHighlightList.length > 0)) { 1795 else if (($rootScope.previousHighlightList != null || $rootScope.previousHighlightList != undefined) && ($rootScope.previousHighlightList.length > 0)) {
1865 angular.forEach($rootScope.previousHighlightList, function (value, key) { 1796 angular.forEach($rootScope.previousHighlightList, function (value, key) {
1866 1797
@@ -2227,6 +2158,38 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo @@ -2227,6 +2158,38 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
2227 grayCanvasContext.putImageData(updatedData, 0, 0); 2158 grayCanvasContext.putImageData(updatedData, 0, 0);
2228 $scope.highlightedBR.push({ 'bodyRegionId': bodyRegionId }); 2159 $scope.highlightedBR.push({ 'bodyRegionId': bodyRegionId });
2229 2160
  2161 +
  2162 + console.log('$scope.highlightedBR.length= ' + $scope.highlightedBR.length)
  2163 +
  2164 + if ($scope.highlightedBR != null || $scope.highlightedBR != undefined) {
  2165 +
  2166 + if ((($rootScope.viewOrientationId == '1') || ($rootScope.viewOrientationId == '4')) && ($scope.highlightedBR.length == 9)) {
  2167 + $scope.doAligneCanvasWithTerm = true;
  2168 + }
  2169 + else if ((($rootScope.viewOrientationId == '2') || ($rootScope.viewOrientationId == '3')) && ($scope.highlightedBR.length == 5)) {
  2170 + $scope.doAligneCanvasWithTerm = true;
  2171 + }
  2172 + else if ((($rootScope.viewOrientationId == '5')) && ($scope.highlightedBR.length == 1)) {
  2173 + $scope.doAligneCanvasWithTerm = true;
  2174 + }
  2175 + else if ((($rootScope.viewOrientationId == '6')) && ($scope.highlightedBR.length == 1)) {
  2176 + $scope.doAligneCanvasWithTerm = true;
  2177 + }
  2178 +
  2179 + if ($scope.doAligneCanvasWithTerm == true) {
  2180 + //debugger;
  2181 + if ($scope.isHighlightBodyByBodySystem == true || $rootScope.isListManagerSelected == true)
  2182 +
  2183 + $rootScope.isLoading = false;
  2184 +
  2185 + $('#spinner').css('visibility', 'hidden');
  2186 +
  2187 + $scope.isHighlightBodyByBodySystem = false;
  2188 +
  2189 + if ($rootScope.isListManagerSelected == true)
  2190 + $scope.aligneCanvasWithTerm();
  2191 + }
  2192 + }
2230 } 2193 }
2231 2194
2232 //debugger; 2195 //debugger;
@@ -2243,37 +2206,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo @@ -2243,37 +2206,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
2243 2206
2244 //$scope.highlightedBR.push({ 'bodyRegionId': bodyRegionId }); 2207 //$scope.highlightedBR.push({ 'bodyRegionId': bodyRegionId });
2245 2208
2246 - console.log('$scope.highlightedBR.length= ' + $scope.highlightedBR.length)  
2247 -  
2248 - if ($scope.highlightedBR != null || $scope.highlightedBR != undefined) {  
2249 -  
2250 - if ((($rootScope.viewOrientationId == '1') || ($rootScope.viewOrientationId == '4')) && ($scope.highlightedBR.length == 9)) {  
2251 - $scope.doAligneCanvasWithTerm = true;  
2252 - }  
2253 - else if ((($rootScope.viewOrientationId == '2') || ($rootScope.viewOrientationId == '3')) && ($scope.highlightedBR.length == 5)) {  
2254 - $scope.doAligneCanvasWithTerm = true;  
2255 - }  
2256 - else if ((($rootScope.viewOrientationId == '5')) && ($scope.highlightedBR.length == 4)) {  
2257 - $scope.doAligneCanvasWithTerm = true;  
2258 - }  
2259 - else if ((($rootScope.viewOrientationId == '6')) && ($scope.highlightedBR.length == 1)) {  
2260 - $scope.doAligneCanvasWithTerm = true;  
2261 - }  
2262 2209
2263 - if ($scope.doAligneCanvasWithTerm == true) {  
2264 - //debugger;  
2265 - if ($scope.isHighlightBodyByBodySystem == true || $rootScope.isListManagerSelected == true)  
2266 -  
2267 - $rootScope.isLoading = false;  
2268 -  
2269 - $('#spinner').css('visibility', 'hidden');  
2270 -  
2271 - $scope.isHighlightBodyByBodySystem = false;  
2272 -  
2273 - if ($rootScope.isListManagerSelected == true)  
2274 - $scope.aligneCanvasWithTerm();  
2275 - }  
2276 - }  
2277 // 2210 //
2278 2211
2279 }; 2212 };
@@ -2420,10 +2353,10 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo @@ -2420,10 +2353,10 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
2420 //layer change function 2353 //layer change function
2421 $scope.LayerChange = function () { 2354 $scope.LayerChange = function () {
2422 2355
2423 - 2356 +
2424 //if listanager is visisble then close it 2357 //if listanager is visisble then close it
2425 $rootScope.isListManagerSelected = false; 2358 $rootScope.isListManagerSelected = false;
2426 - 2359 +
2427 $rootScope.CloseListManager(); 2360 $rootScope.CloseListManager();
2428 2361
2429 2362
@@ -2549,8 +2482,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo @@ -2549,8 +2482,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
2549 if ($scope.isHighlightBodyByBodySystem) { 2482 if ($scope.isHighlightBodyByBodySystem) {
2550 $timeout(function () { $scope.DisableProgressBar() }, 20000); 2483 $timeout(function () { $scope.DisableProgressBar() }, 20000);
2551 } 2484 }
2552 - else  
2553 - { 2485 + else {
2554 $timeout(function () { $scope.DisableProgressBar() }, 2000); 2486 $timeout(function () { $scope.DisableProgressBar() }, 2000);
2555 } 2487 }
2556 } 2488 }
@@ -2714,87 +2646,77 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo @@ -2714,87 +2646,77 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
2714 2646
2715 + '<div style="position:absolute;border:1px solid #000;display:none;z-index:9000;" id="bord">' 2647 + '<div style="position:absolute;border:1px solid #000;display:none;z-index:9000;" id="bord">'
2716 + '</div>'; 2648 + '</div>';
  2649 + $('#canvasDiv').append(sppechBubbleDotHTML);
2717 2650
2718 - //Issue #7286 :Undefined annotation should not appear  
2719 - for (var i = 0; i <= $scope.MultiLanguageAnnationArray.length - 1; i++) {  
2720 - var MultipleLanguage = $scope.MultiLanguageAnnationArray[i];  
2721 - }  
2722 -  
2723 - if (MultipleLanguage == undefined) {  
2724 - console.log("No text is found");  
2725 - } else {  
2726 - $('#canvasDiv').append(sppechBubbleDotHTML);  
2727 -  
2728 - if ($scope.MultiLanguageAnnationArray.length > 0) {  
2729 - for (var i = 0; i <= $scope.MultiLanguageAnnationArray.length - 1; i++) {  
2730 - var MultipleLanguage = $scope.MultiLanguageAnnationArray[i];  
2731 - $("#sppeachBubble").append("<p style='margin-bottom:2px;'>" + MultipleLanguage + "</p>");  
2732 - } 2651 + if ($scope.MultiLanguageAnnationArray.length > 0) {
  2652 + for (var i = 0; i <= $scope.MultiLanguageAnnationArray.length - 1; i++) {
  2653 + var MultipleLanguage = $scope.MultiLanguageAnnationArray[i];
  2654 + $("#sppeachBubble").append("<p style='margin-bottom:2px;'>" + MultipleLanguage + "</p>");
2733 } 2655 }
2734 - else {  
2735 - console.log('MultiLanguageAnnationArray.length is :' + $scope.MultiLanguageAnnationArray.length)  
2736 - }  
2737 - if ($scope.longestAnnotation != null || $scope.longestAnnotation != undefined) {  
2738 - if ($scope.longestAnnotation.length <= 10) { 2656 + }
  2657 + else {
  2658 + console.log('MultiLanguageAnnationArray.length is :' + $scope.MultiLanguageAnnationArray.length)
  2659 + }
  2660 + if ($scope.longestAnnotation != null || $scope.longestAnnotation != undefined) {
  2661 + if ($scope.longestAnnotation.length <= 10) {
2739 2662
2740 2663
2741 - $("#sppeachBubble").css("width", "100px"); 2664 + $("#sppeachBubble").css("width", "100px");
2742 2665
2743 - } 2666 + }
2744 2667
2745 - else if ($scope.longestAnnotation.length > 10 && $scope.longestAnnotation.length <= 17) { 2668 + else if ($scope.longestAnnotation.length > 10 && $scope.longestAnnotation.length <= 17) {
2746 2669
2747 2670
2748 2671
2749 - $("#sppeachBubble").css("width", "140px"); 2672 + $("#sppeachBubble").css("width", "140px");
2750 2673
2751 - }  
2752 - else if ($scope.longestAnnotation.length > 17 && $scope.longestAnnotation.length <= 26) { 2674 + }
  2675 + else if ($scope.longestAnnotation.length > 17 && $scope.longestAnnotation.length <= 26) {
2753 2676
2754 2677
2755 - $("#sppeachBubble").css("width", "195px"); 2678 + $("#sppeachBubble").css("width", "195px");
2756 2679
2757 - }  
2758 - else if ($scope.longestAnnotation.length > 26 && $scope.longestAnnotation.length <= 34) { 2680 + }
  2681 + else if ($scope.longestAnnotation.length > 26 && $scope.longestAnnotation.length <= 34) {
2759 2682
2760 - $("#sppeachBubble").css("width", "248px"); 2683 + $("#sppeachBubble").css("width", "248px");
2761 2684
2762 - }  
2763 - else if ($scope.longestAnnotation.length > 34 && $scope.longestAnnotation.length <= 44) { 2685 + }
  2686 + else if ($scope.longestAnnotation.length > 34 && $scope.longestAnnotation.length <= 44) {
2764 2687
2765 2688
2766 - $("#sppeachBubble").css("width", "300px");  
2767 - } 2689 + $("#sppeachBubble").css("width", "300px");
  2690 + }
2768 2691
2769 - else if ($scope.longestAnnotation.length > 44 && $scope.longestAnnotation.length <= 54) { 2692 + else if ($scope.longestAnnotation.length > 44 && $scope.longestAnnotation.length <= 54) {
2770 2693
2771 - $("#sppeachBubble").css("width", "370px"); 2694 + $("#sppeachBubble").css("width", "370px");
2772 2695
2773 - }  
2774 -  
2775 - else if ($scope.longestAnnotation.length > 54 && $scope.longestAnnotation.length <= 69) { 2696 + }
2776 2697
  2698 + else if ($scope.longestAnnotation.length > 54 && $scope.longestAnnotation.length <= 69) {
2777 2699
2778 - $("#sppeachBubble").css("width", "450px");  
2779 2700
2780 - } 2701 + $("#sppeachBubble").css("width", "450px");
2781 2702
2782 - else if ($scope.longestAnnotation.length > 69 && $scope.longestAnnotation.length <= 75) { 2703 + }
2783 2704
  2705 + else if ($scope.longestAnnotation.length > 69 && $scope.longestAnnotation.length <= 75) {
2784 2706
2785 - $("#sppeachBubble").css("width", "510px");  
2786 2707
2787 - } 2708 + $("#sppeachBubble").css("width", "510px");
2788 2709
2789 - else { 2710 + }
2790 2711
  2712 + else {
2791 2713
2792 - $("#sppeachBubble").css("width", ($scope.longestAnnotation.length) + "%");  
2793 2714
  2715 + $("#sppeachBubble").css("width", ($scope.longestAnnotation.length) + "%");
2794 2716
2795 - }  
2796 2717
2797 } 2718 }
  2719 +
2798 } 2720 }
2799 var Globe = []; 2721 var Globe = [];
2800 Globe.push({ currentX: x, currentY: y }); 2722 Globe.push({ currentX: x, currentY: y });
@@ -3282,54 +3204,44 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo @@ -3282,54 +3204,44 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
3282 3204
3283 $scope.createSpeechBubbleBasedOnAnnotationLength = function (pointClicked, x, y, id) { 3205 $scope.createSpeechBubbleBasedOnAnnotationLength = function (pointClicked, x, y, id) {
3284 var sppechBubbleHTML = "<div id ='" + pointClicked + "' class='com'><div style='z-index:10000;position:absolute;border-top:2px solid #000;transform:rotate(40deg);-moz-transform:rotate(40deg);-o-transform:rotate(40deg);-ms-transform:rotate(40deg);-webkit-transform:rotate(40deg);height:15px;width:35px;left:" + (x - 10) + "px;top:" + (y + 10) + "px;'' id='bubble" + $scope.speechBubbleCounter + "'></div><div data=" + $scope.speechBubbleCounter + " id=" + id + " class='appendDragg' style='z-index:10000;margin-left:25px;border:1px solid #000;padding:5px 10px;position:absolute;color:#000;text-align:left;font-size: 12px;background-color:#fff;font-weight:bold;left:" + x + "px;top:" + y + "px;'><div style='z-index:7000;position:absolute;right:-4px;top:-4px;color:#ffffff;cursor:pointer;'><img id=" + $scope.speechBubbleCounter + " class='dynCross' src=" + $rootScope.path + "></div></div><div style='position:absolute;border:1px solid #000;display:none;z-index:9000;' id='bord" + $scope.speechBubbleCounter + "'></div></div>"; 3206 var sppechBubbleHTML = "<div id ='" + pointClicked + "' class='com'><div style='z-index:10000;position:absolute;border-top:2px solid #000;transform:rotate(40deg);-moz-transform:rotate(40deg);-o-transform:rotate(40deg);-ms-transform:rotate(40deg);-webkit-transform:rotate(40deg);height:15px;width:35px;left:" + (x - 10) + "px;top:" + (y + 10) + "px;'' id='bubble" + $scope.speechBubbleCounter + "'></div><div data=" + $scope.speechBubbleCounter + " id=" + id + " class='appendDragg' style='z-index:10000;margin-left:25px;border:1px solid #000;padding:5px 10px;position:absolute;color:#000;text-align:left;font-size: 12px;background-color:#fff;font-weight:bold;left:" + x + "px;top:" + y + "px;'><div style='z-index:7000;position:absolute;right:-4px;top:-4px;color:#ffffff;cursor:pointer;'><img id=" + $scope.speechBubbleCounter + " class='dynCross' src=" + $rootScope.path + "></div></div><div style='position:absolute;border:1px solid #000;display:none;z-index:9000;' id='bord" + $scope.speechBubbleCounter + "'></div></div>";
3285 - //Issue #7286 :Undefined annotation should not appear 3207 + $("#canvasDiv").append(sppechBubbleHTML);
  3208 +
3286 for (var i = 0; i <= $scope.MultiLanguageAnnationArray.length - 1; i++) { 3209 for (var i = 0; i <= $scope.MultiLanguageAnnationArray.length - 1; i++) {
3287 var annotation = $scope.MultiLanguageAnnationArray[i]; 3210 var annotation = $scope.MultiLanguageAnnationArray[i];
3288 - }  
3289 3211
3290 - if (annotation == undefined) {  
3291 - console.log("No text found");  
3292 - } else {  
3293 -  
3294 - $("#canvasDiv").append(sppechBubbleHTML);  
3295 -  
3296 - for (var i = 0; i <= $scope.MultiLanguageAnnationArray.length - 1; i++) {  
3297 - var annotation = $scope.MultiLanguageAnnationArray[i];  
3298 -  
3299 - $("#" + id).append("<p style='margin-bottom:2px;'>" + annotation + "</p>");  
3300 - } 3212 + $("#" + id).append("<p style='margin-bottom:2px;'>" + annotation + "</p>");
  3213 + }
3301 3214
3302 - if ($scope.longestAnnotation.length <= 10) {  
3303 - $("#" + id).css("width", "100px");  
3304 - } 3215 + if ($scope.longestAnnotation.length <= 10) {
  3216 + $("#" + id).css("width", "100px");
  3217 + }
3305 3218
3306 - else if ($scope.longestAnnotation.length > 10 && $scope.longestAnnotation.length <= 17) {  
3307 - $("#" + id).css("width", "140px");  
3308 - }  
3309 - else if ($scope.longestAnnotation.length > 17 && $scope.longestAnnotation.length <= 26) {  
3310 - $("#" + id).css("width", "195px"); 3219 + else if ($scope.longestAnnotation.length > 10 && $scope.longestAnnotation.length <= 17) {
  3220 + $("#" + id).css("width", "140px");
  3221 + }
  3222 + else if ($scope.longestAnnotation.length > 17 && $scope.longestAnnotation.length <= 26) {
  3223 + $("#" + id).css("width", "195px");
3311 3224
3312 - }  
3313 - else if ($scope.longestAnnotation.length > 26 && $scope.longestAnnotation.length <= 34) {  
3314 - $("#" + id).css("width", "248px");  
3315 - }  
3316 - else if ($scope.longestAnnotation.length > 34 && $scope.longestAnnotation.length <= 44) {  
3317 - $("#" + id).css("width", "300px");  
3318 - } 3225 + }
  3226 + else if ($scope.longestAnnotation.length > 26 && $scope.longestAnnotation.length <= 34) {
  3227 + $("#" + id).css("width", "248px");
  3228 + }
  3229 + else if ($scope.longestAnnotation.length > 34 && $scope.longestAnnotation.length <= 44) {
  3230 + $("#" + id).css("width", "300px");
  3231 + }
3319 3232
3320 - else if ($scope.longestAnnotation.length > 44 && $scope.longestAnnotation.length <= 54) {  
3321 - $("#" + id).css("width", "370px");  
3322 - }  
3323 - else if ($scope.longestAnnotation.length > 54 && $scope.longestAnnotation.length <= 69) {  
3324 - $("#" + id).css("width", "450px");  
3325 - }  
3326 - else if ($scope.longestAnnotation.length > 69 && $scope.longestAnnotation.length <= 75) {  
3327 - $("#" + id).css("width", "510px"); 3233 + else if ($scope.longestAnnotation.length > 44 && $scope.longestAnnotation.length <= 54) {
  3234 + $("#" + id).css("width", "370px");
  3235 + }
  3236 + else if ($scope.longestAnnotation.length > 54 && $scope.longestAnnotation.length <= 69) {
  3237 + $("#" + id).css("width", "450px");
  3238 + }
  3239 + else if ($scope.longestAnnotation.length > 69 && $scope.longestAnnotation.length <= 75) {
  3240 + $("#" + id).css("width", "510px");
3328 3241
3329 - }  
3330 - else {  
3331 - $("#" + id).css("width", ($scope.longestAnnotation.length) + "%");  
3332 - } 3242 + }
  3243 + else {
  3244 + $("#" + id).css("width", ($scope.longestAnnotation.length) + "%");
3333 } 3245 }
3334 } 3246 }
3335 3247
@@ -3428,7 +3340,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo @@ -3428,7 +3340,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
3428 3340
3429 3341
3430 //if listanager is visisble then close it 3342 //if listanager is visisble then close it
3431 - 3343 +
3432 $rootScope.isListManagerSelected = false; 3344 $rootScope.isListManagerSelected = false;
3433 $rootScope.CloseListManager(); 3345 $rootScope.CloseListManager();
3434 3346
@@ -3677,7 +3589,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo @@ -3677,7 +3589,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
3677 3589
3678 $('#btnTranparency').addClass('tButtonActive'); 3590 $('#btnTranparency').addClass('tButtonActive');
3679 //debugger; 3591 //debugger;
3680 - $('#txtlayerNumber').val((parseInt($scope.currentLayerNumber)) + 1); 3592 + // $('#txtlayerNumber').val((parseInt($scope.currentLayerNumber)) + 1);
3681 //Dated:18-07-2016 Issue#4975: Transparency box should not be clickable if it is already selected. 3593 //Dated:18-07-2016 Issue#4975: Transparency box should not be clickable if it is already selected.
3682 $('#btnTranparency').removeClass('tButtonActive'); 3594 $('#btnTranparency').removeClass('tButtonActive');
3683 $('#btnTranparency').addClass('btn-black'); 3595 $('#btnTranparency').addClass('btn-black');
@@ -3847,12 +3759,19 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo @@ -3847,12 +3759,19 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
3847 3759
3848 } 3760 }
3849 else { 3761 else {
  3762 + var tranparencyLayer;
3850 var currentLayer = parseInt($('#txtlayerNumber').val()); 3763 var currentLayer = parseInt($('#txtlayerNumber').val());
  3764 + if (currentLayer == $rootScope.totalLayers) {
3851 3765
3852 - var tranparencyLayer = currentLayer + 1; 3766 + tranparencyLayer = currentLayer;
  3767 + }
  3768 + else {
  3769 + tranparencyLayer = currentLayer + 1;
  3770 + }
3853 $scope.layerNumber = tranparencyLayer; 3771 $scope.layerNumber = tranparencyLayer;
3854 } 3772 }
3855 3773
  3774 + $('#txtlayerNumber').val($scope.layerNumber);
3856 //dedebugger; 3775 //dedebugger;
3857 //1. get the image source 3776 //1. get the image source
3858 var tranparencyImgSrc; 3777 var tranparencyImgSrc;
@@ -4638,7 +4557,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo @@ -4638,7 +4557,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
4638 4557
4639 4558
4640 //if listanager is visisble then close it 4559 //if listanager is visisble then close it
4641 - 4560 +
4642 $rootScope.isListManagerSelected = false; 4561 $rootScope.isListManagerSelected = false;
4643 $rootScope.CloseListManager(); 4562 $rootScope.CloseListManager();
4644 // $('#btnIdentity').addClass('btn-primary'); 4563 // $('#btnIdentity').addClass('btn-primary');
@@ -4681,7 +4600,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo @@ -4681,7 +4600,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
4681 4600
4682 $rootScope.isZoomed = true; 4601 $rootScope.isZoomed = true;
4683 //1. 4602 //1.
4684 - 4603 +
4685 $scope.flushCanvas(); 4604 $scope.flushCanvas();
4686 4605
4687 if ($scope.zoomInOut == 25) { 4606 if ($scope.zoomInOut == 25) {
@@ -4827,7 +4746,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo @@ -4827,7 +4746,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
4827 4746
4828 $scope.enableHighlight = function () { 4747 $scope.enableHighlight = function () {
4829 4748
4830 - 4749 +
4831 4750
4832 4751
4833 //if listanager is visisble then close it 4752 //if listanager is visisble then close it
@@ -4889,15 +4808,12 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo @@ -4889,15 +4808,12 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
4889 } 4808 }
4890 4809
4891 $scope.enableNormalMode = function () { 4810 $scope.enableNormalMode = function () {
4892 -  
4893 - console.log('enableNormalMode is called');  
4894 4811
4895 -  
4896 - // $rootScope.isHighLight = false;  
4897 4812
4898 - //to do should not call every time 4813 + //if listanager is visisble then close it
  4814 +
  4815 + // $rootScope.isListManagerSelected = false;
4899 $rootScope.CloseListManager(); 4816 $rootScope.CloseListManager();
4900 -  
4901 4817
4902 if ($rootScope.isNormalMode == true) { 4818 if ($rootScope.isNormalMode == true) {
4903 4819
@@ -4920,9 +4836,6 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo @@ -4920,9 +4836,6 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
4920 $rootScope.isZoomed = false; 4836 $rootScope.isZoomed = false;
4921 4837
4922 //6. 4838 //6.
4923 - $rootScope.isListManagerSelected = false;  
4924 -  
4925 - //7.  
4926 $scope.CalculateImageCordinates($rootScope.viewOrientationId); 4839 $scope.CalculateImageCordinates($rootScope.viewOrientationId);
4927 4840
4928 4841
@@ -5202,7 +5115,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo @@ -5202,7 +5115,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
5202 $('#spinner').css('visibility', 'hidden'); 5115 $('#spinner').css('visibility', 'hidden');
5203 //} 5116 //}
5204 5117
5205 - 5118 +
5206 if (($scope.isHighlightBodyByBodySystem == true) && ($scope.systemMatchedTermList != null || $scope.systemMatchedTermList != undefined)) { 5119 if (($scope.isHighlightBodyByBodySystem == true) && ($scope.systemMatchedTermList != null || $scope.systemMatchedTermList != undefined)) {
5207 5120
5208 5121
@@ -5212,7 +5125,10 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo @@ -5212,7 +5125,10 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
5212 $timeout(function () { $scope.HighlightBodyByTermList($scope.systemMatchedTermList) }, 100); 5125 $timeout(function () { $scope.HighlightBodyByTermList($scope.systemMatchedTermList) }, 100);
5213 } 5126 }
5214 else if ($rootScope.isListManagerSelected == true) { 5127 else if ($rootScope.isListManagerSelected == true) {
  5128 + console.log('$rootScope.isListManagerSelected == true')
  5129 + $scope.isLoading = true;
5215 5130
  5131 + $('#spinner').css('visibility', 'visible');
5216 // console.log('$scope.grayedBR.length is ' + $scope.grayedBR.length); 5132 // console.log('$scope.grayedBR.length is ' + $scope.grayedBR.length);
5217 $timeout(function () { 5133 $timeout(function () {
5218 5134
@@ -5243,7 +5159,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo @@ -5243,7 +5159,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
5243 console.log('1. $rootScope.isExtract=true and $rootScope.isListManagerSelected == true') 5159 console.log('1. $rootScope.isExtract=true and $rootScope.isListManagerSelected == true')
5244 5160
5245 $timeout(function () { $scope.HighlightBodyOnExtract() }, 50); 5161 $timeout(function () { $scope.HighlightBodyOnExtract() }, 50);
5246 - 5162 +
5247 } 5163 }
5248 } 5164 }
5249 //else { 5165 //else {
@@ -5404,7 +5320,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo @@ -5404,7 +5320,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
5404 else if ($rootScope.isListManagerSelected == true) { 5320 else if ($rootScope.isListManagerSelected == true) {
5405 console.log('2. $rootScope.isExtract=true and $rootScope.isListManagerSelected == true') 5321 console.log('2. $rootScope.isExtract=true and $rootScope.isListManagerSelected == true')
5406 $timeout(function () { $scope.HighlightBodyOnExtract() }, 50); 5322 $timeout(function () { $scope.HighlightBodyOnExtract() }, 50);
5407 - 5323 +
5408 } 5324 }
5409 } 5325 }
5410 5326
@@ -5486,8 +5402,8 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo @@ -5486,8 +5402,8 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
5486 $scope.OnGenderChange = function (event) { 5402 $scope.OnGenderChange = function (event) {
5487 5403
5488 //if listanager is visisble then close it 5404 //if listanager is visisble then close it
5489 -  
5490 - $rootScope.isListManagerSelected = false; 5405 +
  5406 + //$rootScope.isListManagerSelected = false;
5491 $rootScope.CloseListManager(); 5407 $rootScope.CloseListManager();
5492 5408
5493 $rootScope.isLoading = true; 5409 $rootScope.isLoading = true;
@@ -5552,12 +5468,50 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo @@ -5552,12 +5468,50 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
5552 5468
5553 } 5469 }
5554 5470
5555 - $rootScope.openViews.push(  
5556 - {  
5557 - "module": $rootScope.currentActiveModuleTitle, "body-views": localStorage.getItem("currentViewTitle"), "state": 'max', "BodyViewId": currentBodyViewId,  
5558 - "slug": $rootScope.currentSlug  
5559 - }  
5560 - ); 5471 + var correspondingBodyViewId = $scope.correspondingBodyViewIds[currentBodyViewId];
  5472 + var alraedyOpenedViewDetail;
  5473 + if ($rootScope.openViews != null || $rootScope.openViews != undefined) {
  5474 + if ($rootScope.openViews.length > 0) {
  5475 + alraedyOpenedViewDetail = new jinqJs()
  5476 + .from($rootScope.openViews)
  5477 + .where("BodyViewId == " + correspondingBodyViewId)
  5478 + .select();
  5479 + }
  5480 + }
  5481 +
  5482 + if (alraedyOpenedViewDetail != undefined || alraedyOpenedViewDetail.length > 0) {
  5483 + // $rootScope.openViews.removeValue('BodyViewId', correspondingBodyViewId);
  5484 +
  5485 + findAndRemove($rootScope.openViews, 'BodyViewId', correspondingBodyViewId);
  5486 + function findAndRemove(array, property, value) {
  5487 + array.forEach(function (result, index) {
  5488 + if (result[property] === value) {
  5489 + //Remove from array
  5490 + array.splice(index, 1);
  5491 + }
  5492 + });
  5493 + }
  5494 +
  5495 + //Checks countries.result for an object with a property of 'id' whose value is 'AF'
  5496 + //Then removes it ;p
  5497 +
  5498 +
  5499 + $rootScope.openViews.push(
  5500 + {
  5501 + "module": $rootScope.currentActiveModuleTitle, "bodyView": localStorage.getItem("currentViewTitle"), "state": 'max', "BodyViewId": currentBodyViewId,
  5502 + "slug": $rootScope.currentSlug
  5503 + }
  5504 + );
  5505 + }
  5506 +
  5507 + else {
  5508 + $rootScope.openViews.push(
  5509 + {
  5510 + "module": $rootScope.currentActiveModuleTitle, "bodyView": localStorage.getItem("currentViewTitle"), "state": 'max', "BodyViewId": currentBodyViewId,
  5511 + "slug": $rootScope.currentSlug
  5512 + }
  5513 + );
  5514 + }
5561 5515
5562 var target = angular.element(event.currentTarget); 5516 var target = angular.element(event.currentTarget);
5563 var title_male_female = target.attr('title'); 5517 var title_male_female = target.attr('title');
@@ -5628,7 +5582,15 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo @@ -5628,7 +5582,15 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
5628 if (canDivChildCount > 0) { 5582 if (canDivChildCount > 0) {
5629 canDiv.innerHTML = ''; 5583 canDiv.innerHTML = '';
5630 } 5584 }
5631 - $scope.CalculateImageCordinates($rootScope.viewOrientationId); 5585 +
  5586 +
  5587 + //if user seelcted any term and serached before gender cnage then itshould be highlighted in chnaged gender
  5588 + if (($rootScope.isListManagerSelected == true) && ($rootScope.isGenderChnage == true)) {
  5589 + $scope.setLayerNumberAndHighlightByTermList();
  5590 + }
  5591 + else {
  5592 + $scope.CalculateImageCordinates($rootScope.viewOrientationId);
  5593 + }
5632 $scope.currentTitleFromJson = localStorage.getItem("currentViewTitle"); 5594 $scope.currentTitleFromJson = localStorage.getItem("currentViewTitle");
5633 }, 5595 },
5634 function (error) { 5596 function (error) {
@@ -5730,7 +5692,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo @@ -5730,7 +5692,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
5730 5692
5731 $rootScope.openViews.push( 5693 $rootScope.openViews.push(
5732 { 5694 {
5733 - "module": $rootScope.currentActiveModuleTitle, "body-views": localStorage.getItem("currentViewTitle"), "state": 'max', "BodyViewId": $rootScope.voId, 5695 + "module": $rootScope.currentActiveModuleTitle, "bodyView": localStorage.getItem("currentViewTitle"), "state": 'max', "BodyViewId": $rootScope.voId,
5734 "slug": $rootScope.currentSlug 5696 "slug": $rootScope.currentSlug
5735 } 5697 }
5736 ); 5698 );
@@ -5942,8 +5904,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo @@ -5942,8 +5904,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
5942 $rootScope.Object1Index = 0; 5904 $rootScope.Object1Index = 0;
5943 $rootScope.Object2Index = 0; 5905 $rootScope.Object2Index = 0;
5944 $rootScope.resetText = 0; 5906 $rootScope.resetText = 0;
5945 - $rootScope.resetTextSave = 0;  
5946 - $rootScope.ObjectIndexSave = 0; 5907 +
5947 var arrayRect = {}; 5908 var arrayRect = {};
5948 5909
5949 5910
@@ -6072,10 +6033,6 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo @@ -6072,10 +6033,6 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
6072 6033
6073 resizeFromCenter: false, 6034 resizeFromCenter: false,
6074 6035
6075 - dblclick: function () {  
6076 - $rootScope.backOpacity();  
6077 -  
6078 - },  
6079 6036
6080 click: function (layer) { 6037 click: function (layer) {
6081 $rootScope.canvasLayerNameCollection = []; 6038 $rootScope.canvasLayerNameCollection = [];
@@ -6152,7 +6109,6 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo @@ -6152,7 +6109,6 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
6152 6109
6153 6110
6154 click: function (layer) { 6111 click: function (layer) {
6155 - // alert(layer.name);  
6156 $rootScope.canvasLayerNameCollection = []; 6112 $rootScope.canvasLayerNameCollection = [];
6157 $rootScope.canvasLayerNameCollection.push(layer.name); 6113 $rootScope.canvasLayerNameCollection.push(layer.name);
6158 $('#canvas').setLayer(layer.name, { 6114 $('#canvas').setLayer(layer.name, {
@@ -6168,7 +6124,6 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo @@ -6168,7 +6124,6 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
6168 }, 6124 },
6169 mouseout: function (layer) { 6125 mouseout: function (layer) {
6170 $rootScope.canvasLayerNameCollection = []; 6126 $rootScope.canvasLayerNameCollection = [];
6171 -  
6172 $('#canvas').setLayer(layer.name, { 6127 $('#canvas').setLayer(layer.name, {
6173 handle: { 6128 handle: {
6174 type: 'arc', 6129 type: 'arc',
@@ -6295,7 +6250,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo @@ -6295,7 +6250,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
6295 x2: $scope.x, y2: $scope.y, 6250 x2: $scope.x, y2: $scope.y,
6296 6251
6297 click: function (layer) { 6252 click: function (layer) {
6298 - 6253 + // debugger;
6299 $rootScope.shapeTypePin = "Pin"; 6254 $rootScope.shapeTypePin = "Pin";
6300 $rootScope.canvasLayerNameCollection = []; 6255 $rootScope.canvasLayerNameCollection = [];
6301 var pinLine_layer = layer.name; 6256 var pinLine_layer = layer.name;
@@ -6319,7 +6274,9 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo @@ -6319,7 +6274,9 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
6319 6274
6320 }, 6275 },
6321 mouseout: function (layer) { 6276 mouseout: function (layer) {
6322 - 6277 + // $rootScope.resetPinArc = "";
  6278 + // ax = "";
  6279 +
6323 $rootScope.canvasLayerNameCollection = []; 6280 $rootScope.canvasLayerNameCollection = [];
6324 $('#canvas').setLayer(layer.name, { 6281 $('#canvas').setLayer(layer.name, {
6325 handle: { 6282 handle: {
@@ -6382,8 +6339,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo @@ -6382,8 +6339,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
6382 $('.btnCursor').addClass('activebtncolor'); 6339 $('.btnCursor').addClass('activebtncolor');
6383 break; 6340 break;
6384 case "TextArea": 6341 case "TextArea":
6385 - $rootScope.IsTextAlreadySave = false;  
6386 - $("#text_area").val(''); 6342 +
6387 // Draw text 6343 // Draw text
6388 $rootScope.resetTextRect = $rootScope.ObjectIndex++; 6344 $rootScope.resetTextRect = $rootScope.ObjectIndex++;
6389 $rootScope.resetText = $rootScope.ObjectIndex++; 6345 $rootScope.resetText = $rootScope.ObjectIndex++;
@@ -6401,7 +6357,9 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo @@ -6401,7 +6357,9 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
6401 align: "left", 6357 align: "left",
6402 fontFamily: 'Verdana, sans-serif', 6358 fontFamily: 'Verdana, sans-serif',
6403 text: '' 6359 text: ''
6404 - 6360 +
  6361 +
  6362 +
6405 }) 6363 })
6406 // Draw rect as wide as the text 6364 // Draw rect as wide as the text
6407 .drawRect({ 6365 .drawRect({
@@ -6465,8 +6423,6 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo @@ -6465,8 +6423,6 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
6465 6423
6466 $("#annotationTextModal").modal("toggle"); 6424 $("#annotationTextModal").modal("toggle");
6467 $('.btnCursor').trigger('click'); 6425 $('.btnCursor').trigger('click');
6468 - $("#text_area").val('');  
6469 - $("#text_area").css({ " font-family": 'Verdana, sans-serif', "font-size": "14px", "font-weight": "normal", "font-style": "normal", "color": "#000", "text-align": "left", "text-decoration": "none" });  
6470 $(".btn-annotation").removeClass("activebtncolor"); 6426 $(".btn-annotation").removeClass("activebtncolor");
6471 $('.btnCursor').addClass('activebtncolor'); 6427 $('.btnCursor').addClass('activebtncolor');
6472 break; 6428 break;
@@ -6490,275 +6446,129 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo @@ -6490,275 +6446,129 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
6490 $rootScope.underlineText; 6446 $rootScope.underlineText;
6491 $rootScope.textArea; 6447 $rootScope.textArea;
6492 $rootScope.fontFamily; 6448 $rootScope.fontFamily;
6493 - $rootScope.TextPropertyArray = [];  
6494 - $rootScope.modifySavedText = [];  
6495 - $rootScope.TextRectangleArr = [];  
6496 - $rootScope.rectDimension = [];  
6497 - 6449 + $rootScope.saveText = function () {
6498 6450
6499 - // will refactor this code later 6451 + $rootScope.fontSizes = $("#text_area").css("font-size");
  6452 + $rootScope.fontWeight = $("#text_area").css("font-weight");
  6453 + $rootScope.fontStyle = $("#text_area").css("font-style");
  6454 + $rootScope.textAlignmt = $("#text_area").css("text-align");
  6455 + $rootScope.fontColor = $("#text_area").css("color");
  6456 + $rootScope.fontFamily = $("#text_area").css("font-family");
  6457 + $rootScope.underlineText = $("#text_area").css("text-decoration");
  6458 + $rootScope.textArea = $("#text_area").val();
  6459 + $("#canvas").removeLayer('TextArea_' + $rootScope.resetText).drawLayers();
  6460 + $("#canvas").removeLayer("TextRect_" + $rootScope.resetTextRect).drawLayers();
  6461 +
  6462 + $('#canvas').drawText({
  6463 + layer: true,
  6464 + draggable: true,
  6465 + name: 'TextArea_' + $rootScope.resetText,
  6466 + groups: ['TextArea_' + $rootScope.resetText],
  6467 + dragGroups: ['TextArea_' + $rootScope.resetText],
  6468 + fillStyle: $rootScope.fontColor,
  6469 + fontStyle: $rootScope.fontStyle,
  6470 + fontSize: $rootScope.fontSizes,
  6471 + fontFamily: $rootScope.fontFamily,
  6472 + align: $rootScope.textAlignmt,
  6473 + strokeWidth: 0,
  6474 + text: $rootScope.textArea,
  6475 + x: $scope.offsetX1, y: $scope.offsetY1,
  6476 + maxWidth: $scope.x - $scope.offsetX1,
  6477 + maxHeight: $scope.y - $scope.offsetY1,
  6478 +
  6479 +
  6480 + click: function (layer) {
  6481 +
  6482 +
  6483 +
  6484 + },
  6485 + change: function (layer, props) {
  6486 +
  6487 + }
  6488 +
  6489 + })
  6490 + // Draw rect as wide as the text
  6491 + .drawRect({
  6492 + name: 'TextArea1_' + $rootScope.resetText,
  6493 + layer: true,
  6494 + draggable: true,
  6495 + groups: ['TextArea_' + $rootScope.resetText],
  6496 + dragGroups: ['TextArea_' + $rootScope.resetText],
  6497 + opacity: $rootScope.shapestyleOpacity,
  6498 + // strokeStyle: 'black',
  6499 + // strokeWidth: 2,
  6500 + strokeStyle: $rootScope.shapestyleborderColor,
  6501 + strokeWidth: $rootScope.shapestyleborderWidth,
  6502 + // fillStyle: $rootScope.shapestyleFillColor,
  6503 + x: $scope.offsetX1, y: $scope.offsetY1,
  6504 + width: $scope.x - $scope.offsetX1,
  6505 + height: $scope.y - $scope.offsetY1,
  6506 +
  6507 + click: function (layer) {
  6508 + $rootScope.shapeTypeText = "textAreaRect";
  6509 +
  6510 + var layerNameSplit = layer.name;
  6511 +
  6512 + var splitedName = layerNameSplit.split("_");
  6513 +
  6514 + var textValName = "TextArea_";
  6515 +
  6516 + var concatinateResult = textValName.concat(splitedName[1]);
  6517 +
  6518 + $rootScope.canvasLayerNameCollection = [];
  6519 + $rootScope.canvasLayerNameCollection.push({ textareaRectangle: layer.name, textareaString: concatinateResult });
  6520 +
  6521 +
  6522 +
  6523 + $('#canvas').setLayer(layer.name, {
  6524 + handle: {
  6525 + type: 'rectangle',
  6526 + fillStyle: '#fff',
  6527 + strokeStyle: '#c33',
  6528 + strokeWidth: 2,
  6529 + width: 5, height: 5,
  6530 + cornerRadius: 3
  6531 + }
  6532 + }).drawLayers();
  6533 +
  6534 + },
  6535 + mouseout: function (layer) {
  6536 +
  6537 + $rootScope.canvasLayerNameCollection = [];
  6538 + $('#canvas').setLayer(layer.name, {
  6539 + handle: {
  6540 + type: 'rectangle',
  6541 + fillStyle: 'pink',
  6542 + strokeStyle: 'yellow',
  6543 + strokeWidth: 0,
  6544 + width: 0, height: 0,
  6545 + cornerRadius: 0
  6546 + }
  6547 +
  6548 + }).drawLayers();
  6549 +
  6550 + },
  6551 + mouseover: function (layer) {
  6552 +
  6553 + $('#canvas').setLayer(layer.name, {
  6554 + handle: {
  6555 + type: 'rectangle',
  6556 + fillStyle: '#fff',
  6557 + strokeStyle: '#c33',
  6558 + strokeWidth: 2,
  6559 + width: 5, height: 5,
  6560 + cornerRadius: 3
  6561 + }
  6562 + }).drawLayers();
  6563 +
  6564 + }
  6565 + });
  6566 + $("#text_area").val('');
  6567 +
  6568 + $("#text_area").css({ " font-family": "'Verdana, sans-serif'", "font-size": "14px", "font-weight": "normal", "font-style": "normal", "color": "#000", "text-align": "left", "text-decoration": "none" });
6500 6569
6501 -  
6502 - $rootScope.saveText = function () {  
6503 - // this part will work first time when save button will be clicked  
6504 - if ($rootScope.IsTextAlreadySave == false) {  
6505 - // getting textarea style properties  
6506 - $rootScope.fontSizes = $("#text_area").css("font-size");  
6507 - $rootScope.fontWeight = $("#text_area").css("font-weight");  
6508 - $rootScope.fontStyle = $("#text_area").css("font-style");  
6509 - $rootScope.textAlignmt = $("#text_area").css("text-align");  
6510 - $rootScope.fontColor = $("#text_area").css("color");  
6511 - $rootScope.fontFamily = $("#text_area").css("font-family");  
6512 - $rootScope.underlineText = $("#text_area").css("text-decoration");  
6513 - $rootScope.textArea = $("#text_area").val();  
6514 -  
6515 - // deleting previous text area  
6516 -  
6517 - $("#canvas").removeLayer('TextArea_' + $rootScope.resetText).drawLayers();  
6518 - $("#canvas").removeLayer("TextRect_" + $rootScope.resetTextRect).drawLayers();  
6519 -  
6520 - // Text After Saving in Rectangle  
6521 - $('#canvas').drawText({  
6522 - layer: true,  
6523 - draggable: true,  
6524 - name: 'TextArea_' + $rootScope.resetText,  
6525 - groups: ['TextArea_' + $rootScope.resetText],  
6526 - dragGroups: ['TextArea_' + $rootScope.resetText],  
6527 - fillStyle: $rootScope.fontColor,  
6528 - fontStyle: $rootScope.fontStyle,  
6529 - fontSize: $rootScope.fontSizes,  
6530 - fontFamily: $rootScope.fontFamily,  
6531 - align: $rootScope.textAlignmt,  
6532 - strokeWidth: 0,  
6533 - text: $rootScope.textArea,  
6534 - x: $scope.offsetX1, y: $scope.offsetY1,  
6535 - maxWidth: $scope.x - $scope.offsetX1,  
6536 - maxHeight: $scope.y - $scope.offsetY1,  
6537 - add: function (layer) {  
6538 - $rootScope.TextPropertyArray.push({ Text1: '', Align: '', FontColor: '', FontSize: '', FontStyle: '', FontFamily: '' });  
6539 - $rootScope.TextPropertyArray.push({ Text1: layer.text, Align: layer.align, FontColor: layer.fillStyle, FontSize: layer.fontSize, FontStyle: layer.fontStyle, FontFamily: layer.fontFamily });  
6540 - }  
6541 - })  
6542 - // Draw rectangle  
6543 - .drawRect({  
6544 - name: 'TextArea1_' + $rootScope.resetText,  
6545 - layer: true,  
6546 - draggable: true,  
6547 - groups: ['TextArea_' + $rootScope.resetText],  
6548 - dragGroups: ['TextArea_' + $rootScope.resetText],  
6549 - opacity: $rootScope.shapestyleOpacity,  
6550 - strokeStyle: $rootScope.shapestyleborderColor,  
6551 - strokeWidth: $rootScope.shapestyleborderWidth,  
6552 - x: $scope.offsetX1, y: $scope.offsetY1,  
6553 - width: $scope.x - $scope.offsetX1,  
6554 - height: $scope.y - $scope.offsetY1,  
6555 - click: function (layer) {  
6556 - $rootScope.shapeTypeText = "textAreaRect";  
6557 -  
6558 - var layerNameSplit = layer.name;  
6559 - var splitedName = layerNameSplit.split("_");  
6560 - var textValName = "TextArea_";  
6561 - var concatinateResult = textValName.concat(splitedName[1]);  
6562 - $rootScope.canvasLayerNameCollection = [];  
6563 - $rootScope.canvasLayerNameCollection.push({ textareaRectangle: layer.name, textareaString: concatinateResult });  
6564 - $('#canvas').setLayer(layer.name, {  
6565 - handle: {  
6566 - type: 'rectangle',  
6567 - fillStyle: '#fff',  
6568 - strokeStyle: '#c33',  
6569 - strokeWidth: 2,  
6570 - width: 5, height: 5,  
6571 - cornerRadius: 3  
6572 - }  
6573 - }).drawLayers();  
6574 - },  
6575 - dblclick: function (layer) {  
6576 - $rootScope.IsTextAlreadySave = true;  
6577 -  
6578 - var _rectLayerOnSave = layer.name;  
6579 - var _rectLayerOnSaveSplit = _rectLayerOnSave.split("_");  
6580 - var TextAreaRectName = "TextArea_";  
6581 - var TextAreaRectNameConcatenated = TextAreaRectName.concat(_rectLayerOnSaveSplit[1]);  
6582 - $rootScope.modifySavedText.push({ TextName: layer.name, RectText: TextAreaRectNameConcatenated });  
6583 - $rootScope.rectDimension.push({ width: layer.width, height: layer.height, x: layer.x, y: layer.y });  
6584 - var _rectLayerOnSaveSplitInt;  
6585 - if (_rectLayerOnSaveSplit[1] >= 3)  
6586 - _rectLayerOnSaveSplitInt = parseInt(_rectLayerOnSaveSplit[1] - 2);  
6587 - else  
6588 - _rectLayerOnSaveSplitInt = parseInt(_rectLayerOnSaveSplit[1]);  
6589 - var b = $rootScope.TextPropertyArray[_rectLayerOnSaveSplitInt].Text1;  
6590 - $("#text_area").val(b);  
6591 - $("#text_area").css("font-size", $rootScope.TextPropertyArray[_rectLayerOnSaveSplitInt].FontSize);  
6592 - $("#text_area").css("font-weight", $rootScope.TextPropertyArray[_rectLayerOnSaveSplitInt].FontStyle);  
6593 - $("#text_area").css("font-style", $rootScope.TextPropertyArray[_rectLayerOnSaveSplitInt].FontStyle);  
6594 - $("#text_area").css("text-align", $rootScope.TextPropertyArray[_rectLayerOnSaveSplitInt].Align);  
6595 - $("#text_area").css("color", $rootScope.TextPropertyArray[_rectLayerOnSaveSplitInt].FontColor);  
6596 - $("#text_area").css("font-family", $rootScope.TextPropertyArray[_rectLayerOnSaveSplitInt].FontFamily);  
6597 - $("#text_area").css("text-decoration", $rootScope.underlineText);  
6598 - _rectLayerOnSaveSplitInt = ''; b = '';  
6599 - $("#annotationTextModal").modal("toggle");  
6600 - },  
6601 - mouseout: function (layer) {  
6602 - $rootScope.canvasLayerNameCollection = [];  
6603 - $('#canvas').setLayer(layer.name, {  
6604 - handle: {  
6605 - type: 'rectangle',  
6606 - fillStyle: 'pink',  
6607 - strokeStyle: 'yellow',  
6608 - strokeWidth: 0,  
6609 - width: 0, height: 0,  
6610 - cornerRadius: 0  
6611 - }  
6612 - }).drawLayers();  
6613 - },  
6614 - mouseover: function (layer) {  
6615 - $('#canvas').setLayer(layer.name, {  
6616 - handle: {  
6617 - type: 'rectangle',  
6618 - fillStyle: '#fff',  
6619 - strokeStyle: '#c33',  
6620 - strokeWidth: 2,  
6621 - width: 5, height: 5,  
6622 - cornerRadius: 3  
6623 - }  
6624 - }).drawLayers();  
6625 -  
6626 - }  
6627 - });  
6628 - $("#text_area").val('');  
6629 - $("#text_area").css({ " font-family": "'Verdana, sans-serif'", "font-size": "14px", "font-weight": "normal", "font-style": "normal", "color": "#000", "text-align": "left", "text-decoration": "none" });  
6630 -  
6631 - }  
6632 -  
6633 -// this part will work second time when save button will be clicked  
6634 - else {  
6635 - // getting textarea style properties  
6636 - var _modifiedText = $("#text_area").val();  
6637 - var _modifiedFontSize = $("#text_area").css("font-size");  
6638 - var _modifiedFontWeight = $("#text_area").css("font-weight");  
6639 - var _modifiedFontStyle = $("#text_area").css("font-style");  
6640 - var _modifiedTextAlign = $("#text_area").css("text-align");  
6641 - var _modifiedFontColor = $("#text_area").css("color");  
6642 - var _modifiedFontFamily = $("#text_area").css("font-family");  
6643 - var _modifiedFontDecoration = $("#text_area").css("text-decoration");  
6644 -  
6645 - // deleting previous textarea  
6646 - $("#canvas").removeLayer($rootScope.modifySavedText[0].RectText).drawLayers();  
6647 - $("#canvas").removeLayer($rootScope.modifySavedText[0].TextName).drawLayers();  
6648 - $rootScope.resetTextRectSave = $rootScope.ObjectIndexSave++;  
6649 - $rootScope.resetTextSave = $rootScope.ObjectIndexSave++;  
6650 -  
6651 - // generating new text area  
6652 - $('#canvas').drawText({  
6653 - layer: true,  
6654 - draggable: true,  
6655 - name: 'TextAreaAfterEdit_' + $rootScope.resetTextSave,  
6656 - groups: ['TextAreaAfterEdit_' + $rootScope.resetTextSave],  
6657 - dragGroups: ['TextAreaAfterEdit_' + $rootScope.resetTextSave],  
6658 - fillStyle: _modifiedFontColor,  
6659 - fontStyle: _modifiedFontStyle,  
6660 - fontSize: _modifiedFontSize,  
6661 - fontFamily: _modifiedFontFamily,  
6662 - align: _modifiedTextAlign,  
6663 - strokeWidth: 0,  
6664 - text: _modifiedText,  
6665 - x: $rootScope.rectDimension[$rootScope.rectDimension.length - 1].x, y: $rootScope.rectDimension[$rootScope.rectDimension.length - 1].y,  
6666 - maxWidth: $rootScope.rectDimension[$rootScope.rectDimension.length - 1].width,  
6667 - maxHeight: $rootScope.rectDimension[$rootScope.rectDimension.length - 1].height  
6668 -  
6669 - })  
6670 - // Draw rect as wide as the text  
6671 - .drawRect({  
6672 - name: 'TextAreaAfterEditRect_' + $rootScope.resetTextSave,  
6673 - layer: true,  
6674 - draggable: true,  
6675 - groups: ['TextAreaAfterEdit_' + $rootScope.resetTextSave],  
6676 - dragGroups: ['TextAreaAfterEdit_' + $rootScope.resetTextSave],  
6677 - opacity: $rootScope.shapestyleOpacity,  
6678 - strokeStyle: $rootScope.shapestyleborderColor,  
6679 - strokeWidth: $rootScope.shapestyleborderWidth,  
6680 - x: $rootScope.rectDimension[$rootScope.rectDimension.length - 1].x, y: $rootScope.rectDimension[$rootScope.rectDimension.length - 1].y,  
6681 - width: $rootScope.rectDimension[$rootScope.rectDimension.length - 1].width,  
6682 - height: $rootScope.rectDimension[$rootScope.rectDimension.length - 1].height,  
6683 - click: function (layer) {  
6684 - $rootScope.shapeTypeText = "textAreaRect";  
6685 - var layerNameSplit = layer.name;  
6686 - var splitedName = layerNameSplit.split("_");  
6687 - var textValName = "TextAreaAfterEdit_";  
6688 - var concatinateResult = textValName.concat(splitedName[1]);  
6689 - $rootScope.canvasLayerNameCollection = [];  
6690 - $rootScope.canvasLayerNameCollection.push({ textareaRectangle: layer.name, textareaString: concatinateResult });  
6691 -  
6692 - $('#canvas').setLayer(layer.name, {  
6693 - handle: {  
6694 - type: 'rectangle',  
6695 - fillStyle: '#fff',  
6696 - strokeStyle: '#c33',  
6697 - strokeWidth: 2,  
6698 - width: 5, height: 5,  
6699 - cornerRadius: 3  
6700 - }  
6701 - }).drawLayers();  
6702 -  
6703 - },  
6704 - dblclick: function (layer) {  
6705 -  
6706 - $rootScope.IsTextAlreadySave = true;  
6707 - var _rectLayerOnSave = layer.name;  
6708 - var _rectLayerOnSaveSplit = _rectLayerOnSave.split("_");  
6709 - var RectNameAfterEdit = "TextAreaAfterEdit_";  
6710 - var RectNameAfterEditResult = RectNameAfterEdit.concat(_rectLayerOnSaveSplit[1]);  
6711 - $rootScope.modifySavedText.push({ TextName: layer.name, RectText: RectNameAfterEditResult });  
6712 - $rootScope.rectDimension.push({ width: layer.width, height: layer.height, x: layer.x, y: layer.y });  
6713 - $("#text_area").val(_modifiedText);  
6714 - $("#text_area").css("font-size", _modifiedFontSize);  
6715 - $("#text_area").css("font-weight", _modifiedFontWeight);  
6716 - $("#text_area").css("font-style", _modifiedFontStyle);  
6717 - $("#text_area").css("text-align", _modifiedTextAlign);  
6718 - $("#text_area").css("color", _modifiedFontColor);  
6719 - $("#text_area").css("font-family", _modifiedFontFamily);  
6720 - $("#text_area").css("text-decoration", _modifiedFontDecoration);  
6721 - $("#annotationTextModal").modal("toggle");  
6722 - },  
6723 - mouseout: function (layer) {  
6724 - $rootScope.canvasLayerNameCollection = [];  
6725 - $('#canvas').setLayer(layer.name, {  
6726 - handle: {  
6727 - type: 'rectangle',  
6728 - fillStyle: 'pink',  
6729 - strokeStyle: 'yellow',  
6730 - strokeWidth: 0,  
6731 - width: 0, height: 0,  
6732 - cornerRadius: 0  
6733 - }  
6734 - }).drawLayers();  
6735 - },  
6736 - mouseover: function (layer) {  
6737 - $('#canvas').setLayer(layer.name, {  
6738 - handle: {  
6739 - type: 'rectangle',  
6740 - fillStyle: '#fff',  
6741 - strokeStyle: '#c33',  
6742 - strokeWidth: 2,  
6743 - width: 5, height: 5,  
6744 - cornerRadius: 3  
6745 - }  
6746 - }).drawLayers();  
6747 -  
6748 - }  
6749 - });  
6750 - $rootScope.modifySavedText = [];  
6751 -  
6752 - }  
6753 } 6570 }
6754 -  
6755 - // deleting text area on close button  
6756 - $rootScope.closeModal = function () {  
6757 6571
6758 - $("#canvas").removeLayer('TextArea_' + $rootScope.resetText).drawLayers();  
6759 - $("#canvas").removeLayer("TextRect_" + $rootScope.resetTextRect).drawLayers();  
6760 -  
6761 - }  
6762 6572
6763 6573
6764 function OnPaintCanvasMouseMove(event) { 6574 function OnPaintCanvasMouseMove(event) {
@@ -6767,7 +6577,13 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo @@ -6767,7 +6577,13 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
6767 } 6577 }
6768 6578
6769 $rootScope.FreeStylePaint = function (e) { 6579 $rootScope.FreeStylePaint = function (e) {
6770 - 6580 + // debugger;
  6581 +
  6582 +
  6583 + // $rootScope.shapeType = "FreeStylePaint";
  6584 + canvasPaint.addEventListener('mouseup', $scope.OnPaintBrushCanvasMouseUp, false);
  6585 + canvasPaint.addEventListener('mousedown', $scope.OnPaintBrushCanvasMouseDown, false);
  6586 +
6771 6587
6772 } 6588 }
6773 $scope.OnPaintBrushCanvasMouseDown = function (event) { 6589 $scope.OnPaintBrushCanvasMouseDown = function (event) {
@@ -6775,22 +6591,19 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo @@ -6775,22 +6591,19 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
6775 6591
6776 case "FreeStylePaint": 6592 case "FreeStylePaint":
6777 6593
6778 -  
6779 -  
6780 - // $('#canvasPaint').sketch();  
6781 - // $('#canvasPaint').sketch({ defaultSize: 1 });  
6782 - // if ($("#amount-2").val() == '') {  
6783 - // //$('#canvasPaint').sketch({ defaultSize: $scope.shapesize });  
6784 - // $('#canvasPaint').sketch();  
6785 - // }  
6786 - // else { 6594 + debugger;
  6595 + $('#canvasPaint').sketch({ defaultSize: 1 });
  6596 + //if ($("#amount-2").val() == '') {
  6597 + // $('#canvasPaint').sketch({ defaultSize: $scope.shapesize });
  6598 + //}
  6599 + //else {
6787 6600
6788 - // // var a = $("#amount-2").val();  
6789 - //// $scope.shapesize = parseInt(a);  
6790 - // // $('#canvasPaint').sketch({ defaultSize: $rootScope.shapeSize });  
6791 - // // $('#canvasPaint').sketch({ defaultSize: $scope.shapesize }); 6601 + // var a = $("#amount-2").val();
  6602 + // $scope.shapesize = parseInt(a);
  6603 + // // alert(JSON.stringify({ defaultSize: $scope.shapesize }));
  6604 + // $('#canvasPaint').sketch({ defaultSize: $scope.shapesize });
6792 6605
6793 - // } 6606 + //}
6794 6607
6795 6608
6796 break; 6609 break;
@@ -6808,7 +6621,8 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo @@ -6808,7 +6621,8 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
6808 6621
6809 // case "FreeStylePaint": 6622 // case "FreeStylePaint":
6810 6623
6811 - 6624 + // debugger;
  6625 +
6812 // if ($("#amount-2").val() == '') 6626 // if ($("#amount-2").val() == '')
6813 // { 6627 // {
6814 // $('#canvasPaint').sketch({ defaultSize: $scope.shapesize }); 6628 // $('#canvasPaint').sketch({ defaultSize: $scope.shapesize });
@@ -6836,7 +6650,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo @@ -6836,7 +6650,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
6836 6650
6837 6651
6838 if (event.which == 46) { 6652 if (event.which == 46) {
6839 - 6653 + //debugger;
6840 if ($rootScope.shapeTypePin == "Pin") { 6654 if ($rootScope.shapeTypePin == "Pin") {
6841 6655
6842 6656
@@ -7169,16 +6983,10 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo @@ -7169,16 +6983,10 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
7169 } 6983 }
7170 6984
7171 $scope.jumpToTerm = function (event) { 6985 $scope.jumpToTerm = function (event) {
7172 -  
7173 -  
7174 - //1.  
7175 $scope.searchFilter = event.currentTarget.innerHTML; 6986 $scope.searchFilter = event.currentTarget.innerHTML;
7176 -  
7177 - //2.  
7178 $scope.HighlightBodyOnListManagerSelection(event); 6987 $scope.HighlightBodyOnListManagerSelection(event);
7179 6988
7180 $scope.IsSearchVisible = false; 6989 $scope.IsSearchVisible = false;
7181 - $rootScope.isNormalMode = false;  
7182 6990
7183 //Highlight only Highlight button 6991 //Highlight only Highlight button
7184 6992
@@ -7226,7 +7034,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo @@ -7226,7 +7034,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
7226 7034
7227 //list manager 7035 //list manager
7228 $scope.$on('listManagerEvent', function (event, data) { 7036 $scope.$on('listManagerEvent', function (event, data) {
7229 - 7037 + // debugger;
7230 $('#spinner').css('visibility', 'visible'); 7038 $('#spinner').css('visibility', 'visible');
7231 console.log('listManagerEvent') 7039 console.log('listManagerEvent')
7232 if ($rootScope.islistManagerEventAlredayDispachted == true) { 7040 if ($rootScope.islistManagerEventAlredayDispachted == true) {
@@ -7247,8 +7055,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo @@ -7247,8 +7055,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
7247 }) 7055 })
7248 7056
7249 7057
7250 -  
7251 - 7058 + $('#viewName').empty();
7252 var currentView = localStorage.getItem("currentViewTitle"); 7059 var currentView = localStorage.getItem("currentViewTitle");
7253 var viewNmeHtml = '<option>' + currentView + '</option>' 7060 var viewNmeHtml = '<option>' + currentView + '</option>'
7254 $('#viewName').append(viewNmeHtml); 7061 $('#viewName').append(viewNmeHtml);
@@ -7327,25 +7134,33 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo @@ -7327,25 +7134,33 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
7327 7134
7328 7135
7329 } 7136 }
7330 - } 7137 + }
7331 7138
7332 7139
7333 $scope.HighlightBodyOnListManagerSelection = function (event) { 7140 $scope.HighlightBodyOnListManagerSelection = function (event) {
7334 7141
7335 $scope.terminateCurrentlyRunningWPs(); 7142 $scope.terminateCurrentlyRunningWPs();
7336 - 7143 + //debugger
7337 $rootScope.isListManagerSelected = true; 7144 $rootScope.isListManagerSelected = true;
7338 -  
7339 - $rootScope.setScrollBasedOnSearch = true;  
7340 -  
7341 $rootScope.isLoading = true; 7145 $rootScope.isLoading = true;
7342 7146
7343 $('#spinner').css('visibility', 'visible'); 7147 $('#spinner').css('visibility', 'visible');
7344 //1. 7148 //1.
7345 - var actualTermNumber = event.currentTarget.id;//attributes[0].value;  
7346 - $scope.TermList = $scope.getTermNumberList(actualTermNumber); 7149 + $rootScope.actualTermNumber = event.currentTarget.id;//attributes[0].value;
  7150 + console.log(' $scope.actualTermNumber insde HighlightBodyOnListManagerSelection= ' + $rootScope.actualTermNumber)
7347 7151
7348 //2. 7152 //2.
  7153 +
  7154 + $scope.setLayerNumberAndHighlightByTermList();
  7155 +
  7156 +
  7157 + }
  7158 +
  7159 + $scope.setLayerNumberAndHighlightByTermList = function () {
  7160 + console.log(' $scope.actualTermNumber insde setLayerNumberAndHighlightByTermList= ' + $rootScope.actualTermNumber)
  7161 +
  7162 + $scope.TermList = $scope.getTermNumberList($rootScope.actualTermNumber);
  7163 +
7349 var internalLayerNumberList = []; 7164 var internalLayerNumberList = [];
7350 for (var i = 0; i < $scope.TermList.length; i++) { 7165 for (var i = 0; i < $scope.TermList.length; i++) {
7351 var layerNumber = $scope.TermList[i]._InternalLayerNumber 7166 var layerNumber = $scope.TermList[i]._InternalLayerNumber
@@ -7385,9 +7200,9 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo @@ -7385,9 +7200,9 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
7385 $scope.layerNumber = layerNumber; 7200 $scope.layerNumber = layerNumber;
7386 7201
7387 //4.get scroll position 7202 //4.get scroll position
7388 - if (actualTermNumber != DA[0].SKIN_TERM_ID) { 7203 + if ($rootScope.actualTermNumber != DA[0].SKIN_TERM_ID) {
7389 7204
7390 - $scope.termCoordinate = $scope.getTermCoordinate(actualTermNumber); 7205 + $scope.termCoordinate = $scope.getTermCoordinate($rootScope.actualTermNumber);
7391 7206
7392 } 7207 }
7393 7208
@@ -7402,7 +7217,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo @@ -7402,7 +7217,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
7402 //6. 7217 //6.
7403 var matchedDataonActualTerm = new jinqJs() 7218 var matchedDataonActualTerm = new jinqJs()
7404 .from($scope.matchdedDataOnLayer) 7219 .from($scope.matchdedDataOnLayer)
7405 - .where('_ActualTermNumber == ' + actualTermNumber) 7220 + .where('_ActualTermNumber == ' + $scope.actualTermNumber)
7406 .select('_TermNumber'); 7221 .select('_TermNumber');
7407 7222
7408 if (matchedDataonActualTerm != null || matchedDataonActualTerm != undefined) { 7223 if (matchedDataonActualTerm != null || matchedDataonActualTerm != undefined) {
@@ -7440,9 +7255,6 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo @@ -7440,9 +7255,6 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
7440 //redraw body of respective layer 7255 //redraw body of respective layer
7441 $scope.CalculateImageCordinates($rootScope.viewOrientationId) 7256 $scope.CalculateImageCordinates($rootScope.viewOrientationId)
7442 }, 500); 7257 }, 500);
7443 -  
7444 -  
7445 -  
7446 } 7258 }
7447 7259
7448 $scope.getChildTermList = function (termNo) { 7260 $scope.getChildTermList = function (termNo) {
@@ -7519,28 +7331,59 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo @@ -7519,28 +7331,59 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
7519 7331
7520 var canvasX = parseInt($('#canvasDiv').css('left')); 7332 var canvasX = parseInt($('#canvasDiv').css('left'));
7521 var canvasY = parseInt($('#canvasDiv').css('top')); 7333 var canvasY = parseInt($('#canvasDiv').css('top'));
7522 - var canvasWidth = parseInt($('#canvasDiv').css('width'));  
7523 - var canvasHeight = parseInt($('#canvasDiv').css('height')); 7334 + //var canvasWidth = parseInt($('#canvasDiv').css('width'));
  7335 + // var canvasHeight = parseInt($('#canvasDiv').css('height'));
  7336 +
  7337 +
  7338 + var canvasHeight = $('#canvasDiv').height();
  7339 + var canvasWidth = $('#canvasDiv').width();
  7340 +
7524 var canvasBottom = canvasY + canvasHeight; 7341 var canvasBottom = canvasY + canvasHeight;
7525 var canvasRight = canvasX + canvasWidth 7342 var canvasRight = canvasX + canvasWidth
7526 7343
  7344 + if (newX < canvasX || newX > canvasRight || newY < canvasY || newY > canvasBottom) {
  7345 + //if (newX >= canvasX && newX <= canvasRight && newY >= canvasY && newY <= canvasBottom) {
7527 7346
7528 - if (newX >= canvasX && newX <= canvasRight && newY >= canvasY && newY <= canvasBottom) { 7347 + //}
  7348 + //else {
7529 7349
7530 - }  
7531 - else { 7350 +
  7351 +
  7352 + console.log('aligneCanvasWithTerm IF')
  7353 + console.log('aligneCanvasWithTerm ELSE')
7532 newX = newX - canvasWidth / 2; 7354 newX = newX - canvasWidth / 2;
7533 newY = newY - canvasHeight / 2; 7355 newY = newY - canvasHeight / 2;
7534 7356
  7357 + var maxVScrollPos = $('#canvasDiv')[0].scrollHeight;
  7358 + var maxHScrollPos = $('#canvasDiv')[0].scrollWidth;
  7359 +
  7360 + if (newY < maxVScrollPos) {
  7361 + newY = newY;
  7362 + }
  7363 + else {
  7364 + newY = maxVScrollPos;
  7365 + }
  7366 +
  7367 + //Conditions checked for Horizontal Scroll Position
  7368 + if (newX < maxHScrollPos) {
  7369 + newX = newX;
  7370 + }
  7371 + else {
  7372 + newX = maxHScrollPos;
  7373 + }
  7374 +
  7375 + $('#canvasDiv').scrollLeft(newX);
  7376 + $('#canvasDiv').scrollTop(newY);
  7377 +
7535 } 7378 }
7536 7379
7537 7380
7538 7381
7539 console.log('newX =' + newX + ',newY= ' + newY) 7382 console.log('newX =' + newX + ',newY= ' + newY)
7540 - $rootScope.xOnSearch= $('#canvasDiv').scrollLeft(newX);  
7541 - $rootScope.yOnSearch = $('#canvasDiv').scrollTop(newY);  
7542 7383
7543 7384
  7385 + $scope.isLoading = false;
  7386 + $('#spinner').css('visibility', 'hidden');
7544 } 7387 }
7545 7388
7546 $scope.scaleValue = function (nValue, nNewZoom, nExistingZoom) { 7389 $scope.scaleValue = function (nValue, nNewZoom, nExistingZoom) {
400-SOURCECODE/AIAHTML5.Web/app/controllers/HomeController.js
@@ -66,18 +66,18 @@ AIA.controller(&quot;HomeController&quot;, [&quot;$rootScope&quot;, &quot;Modules&quot;, &quot;$log&quot;, &quot;$location&quot;, @@ -66,18 +66,18 @@ AIA.controller(&quot;HomeController&quot;, [&quot;$rootScope&quot;, &quot;Modules&quot;, &quot;$log&quot;, &quot;$location&quot;,
66 66
67 var alreadyOpenThisView = new jinqJs() 67 var alreadyOpenThisView = new jinqJs()
68 .from($rootScope.openViews) 68 .from($rootScope.openViews)
69 - .where("body-views == " + title) 69 + .where("bodyView == " + title)
70 .select(); 70 .select();
71 var k = 0; 71 var k = 0;
72 if (alreadyOpenThisView != null) { 72 if (alreadyOpenThisView != null) {
73 for (var i = 0; i < $rootScope.openViews.length; i++) { 73 for (var i = 0; i < $rootScope.openViews.length; i++) {
74 k++; 74 k++;
75 - if ($rootScope.openViews[i].body - views == title) { 75 + if ($rootScope.openViews[i].bodyView == title) {
76 $rootScope.openViews.splice((k - 1), 1); 76 $rootScope.openViews.splice((k - 1), 1);
77 77
78 $rootScope.openViews.push( 78 $rootScope.openViews.push(
79 { 79 {
80 - "module": $rootScope.currentActiveModuleTitle, "body-views": title, "state": state, "BodyViewId": $rootScope.currentBodyViewId, 80 + "module": $rootScope.currentActiveModuleTitle, "bodyView": title, "state": state, "BodyViewId": $rootScope.currentBodyViewId,
81 "slug": $rootScope.currentSlug 81 "slug": $rootScope.currentSlug
82 } 82 }
83 ); 83 );
@@ -130,30 +130,10 @@ AIA.controller(&quot;HomeController&quot;, [&quot;$rootScope&quot;, &quot;Modules&quot;, &quot;$log&quot;, &quot;$location&quot;, @@ -130,30 +130,10 @@ AIA.controller(&quot;HomeController&quot;, [&quot;$rootScope&quot;, &quot;Modules&quot;, &quot;$log&quot;, &quot;$location&quot;,
130 } 130 }
131 131
132 $rootScope.OnIdentifyClick = function () { 132 $rootScope.OnIdentifyClick = function () {
133 - // $rootScope.isIdetifyClicked = true;  
134 - // $rootScope.isDrawingToolSelected = false;  
135 - $("#canvasPaint").css("display", "none");  
136 - $("#canvas").css("display", "none");  
137 -  
138 - // $("#canvasPaint").css("z-index", "0");  
139 - // $("#canvas").css("z-index", "0");  
140 - $('.btnCursor').removeClass('activebtncolor');  
141 - 133 + $rootScope.isIdetifyClicked = true;
  134 + $rootScope.isDrawingToolSelected = false;
142 } 135 }
143 136
144 -  
145 -  
146 - $rootScope.DrawingMode = function () {  
147 -  
148 - $('.btnCursor').addClass('activebtncolor');  
149 - $rootScope.switchCanvas();  
150 - $("#canvasPaint").css("display", "block");  
151 - $("#canvas").css("display", "block");  
152 -  
153 - }  
154 -  
155 -  
156 -  
157 //----Annotation Toolbar: Jcanvas----- 137 //----Annotation Toolbar: Jcanvas-----
158 138
159 $rootScope.DrawLine = function (e) { 139 $rootScope.DrawLine = function (e) {
@@ -195,24 +175,12 @@ AIA.controller(&quot;HomeController&quot;, [&quot;$rootScope&quot;, &quot;Modules&quot;, &quot;$log&quot;, &quot;$location&quot;, @@ -195,24 +175,12 @@ AIA.controller(&quot;HomeController&quot;, [&quot;$rootScope&quot;, &quot;Modules&quot;, &quot;$log&quot;, &quot;$location&quot;,
195 $(".btn-annotation-rectangle").addClass("activebtncolor"); 175 $(".btn-annotation-rectangle").addClass("activebtncolor");
196 } 176 }
197 $rootScope.paintBrush = function () { 177 $rootScope.paintBrush = function () {
198 - // debugger;  
199 - // $('.btnCursor').addClass('activebtncolor');  
200 - $rootScope.switchCanvasToPaintCanvas();  
201 - $rootScope.shapeType = "FreeStylePaint";  
202 - var a = $("#amount-2").val();  
203 - $rootScope.shapeSize = parseInt(a);  
204 - if ($rootScope.shapeSize == '') {  
205 - $('#canvasPaint').sketch({ defaultSize: 1 });  
206 - }  
207 - else {  
208 - $('#canvasPaint').sketch({ defaultSize: $rootScope.shapeSize });  
209 -  
210 - }  
211 -  
212 -  
213 - // $('#canvasPaint').sketch();  
214 178
  179 + $('.btnCursor').addClass('activebtncolor');
  180 + $rootScope.switchCanvasToPaintCanvas();
215 181
  182 + $rootScope.shapeType = "FreeStylePaint";
  183 + //alert($rootScope.shapeType);
216 184
217 } 185 }
218 186
@@ -251,8 +219,7 @@ AIA.controller(&quot;HomeController&quot;, [&quot;$rootScope&quot;, &quot;Modules&quot;, &quot;$log&quot;, &quot;$location&quot;, @@ -251,8 +219,7 @@ AIA.controller(&quot;HomeController&quot;, [&quot;$rootScope&quot;, &quot;Modules&quot;, &quot;$log&quot;, &quot;$location&quot;,
251 $('.btnCursor').removeClass('activebtncolor'); 219 $('.btnCursor').removeClass('activebtncolor');
252 $(".btn-annotation").removeClass("activebtncolor"); 220 $(".btn-annotation").removeClass("activebtncolor");
253 $(".btn-annotation-Text").addClass("activebtncolor"); 221 $(".btn-annotation-Text").addClass("activebtncolor");
254 - // $("#text_area").val('');  
255 - // $("#text_area").css({ " font-family": 'Verdana, sans-serif', "font-size": "14px", "font-weight": "normal", "font-style": "normal", "color": "#000", "text-align": "left", "text-decoration": "none" }); 222 +
256 } 223 }
257 224
258 $rootScope.DrawPolygon = function () { 225 $rootScope.DrawPolygon = function () {
@@ -309,14 +276,7 @@ AIA.controller(&quot;HomeController&quot;, [&quot;$rootScope&quot;, &quot;Modules&quot;, &quot;$log&quot;, &quot;$location&quot;, @@ -309,14 +276,7 @@ AIA.controller(&quot;HomeController&quot;, [&quot;$rootScope&quot;, &quot;Modules&quot;, &quot;$log&quot;, &quot;$location&quot;,
309 $rootScope.shapestyleborderWidth = intPart[0]; 276 $rootScope.shapestyleborderWidth = intPart[0];
310 $rootScope.shapestyleborderStyles = "solid"; 277 $rootScope.shapestyleborderStyles = "solid";
311 278
312 -  
313 $('#editshapestyle').modal('hide'); 279 $('#editshapestyle').modal('hide');
314 - // name: 'Circle_' + $rootScope.resetCircle,  
315 -  
316 -  
317 - // $("#canvas").removeLayer("TextRect_" + $rootScope.resetTextRect).drawLayers();  
318 -  
319 -  
320 } 280 }
321 281
322 $rootScope.enableAnnotationToolBar = function () { 282 $rootScope.enableAnnotationToolBar = function () {