Commit 1381a9da1dd942f45939b2c42899edc0033a6636

Authored by Nikita Kulshreshtha
1 parent c5a293c8

after cahngeing layerNumber from scope to rootscope , there was issue in layerch…

…ange so reverted that zand fix skintone settings issue by setting layerNumber again on event which is called by skintonechane
400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js
... ... @@ -24,7 +24,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
24 24 $scope.drawnBodyRegions;
25 25 //view specific constants
26 26 $rootScope.voId;
27   - $rootScope.layerNumber;
  27 + $scope.layerNumber;
28 28 $scope.daCounter = 1;
29 29 $scope.bagartDetails;
30 30 $scope.transNumber = 50;
... ... @@ -624,7 +624,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
624 624  
625 625 $rootScope.isNormalMode = true;
626 626  
627   - $rootScope.layerNumber = 0;
  627 + $scope.layerNumber = 0;
628 628 $scope.skinTone = $rootScope.globalSetting.ethnicity;
629 629  
630 630 $rootScope.viewOrientationId = $rootScope.voId;
... ... @@ -840,7 +840,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
840 840  
841 841 if ((dtlOfSktn != null || dtlOfSktn != undefined) && (dtlOfSktn.length > 0)) {
842 842  
843   - if ((parseInt(dtlOfSktn[0]._lns) <= parseInt($rootScope.layerNumber)) && (parseInt(dtlOfSktn[0]._lne) > parseInt($rootScope.layerNumber)) && (dtlOfSktn[0]._isfr == 'Y')) {
  843 + if ((parseInt(dtlOfSktn[0]._lns) <= parseInt($scope.layerNumber)) && (parseInt(dtlOfSktn[0]._lne) > parseInt($scope.layerNumber)) && (dtlOfSktn[0]._isfr == 'Y')) {
844 844 $scope.figLaefImageName = dtlOfSktn[0]._ImageId;
845 845 //$scope.figLaefX = filtereddata[0]._X;
846 846 //$scope.figLaefY = filtereddata[0]._Y;
... ... @@ -895,7 +895,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
895 895 $('#canvasDiv').scrollTop(50)
896 896 var abc = $rootScope.BodyRegionCordinatesData;
897 897 //debugger;
898   - $('#layerChangeSlider').slider("option", "value", parseInt($scope.totalLayers) - parseInt($rootScope.layerNumber));
  898 + $('#layerChangeSlider').slider("option", "value", parseInt($scope.totalLayers) - parseInt($scope.layerNumber));
899 899 // $('#spinner').css('visibility', 'hidden');
900 900 $rootScope.isLoading = false;
901 901 //Dated:16-07-2016 Issue #4957 :While selecting the Zoom-in\Zoom-out button scroll should be go on top.
... ... @@ -1001,19 +1001,19 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
1001 1001 // debugger
1002 1002 $('#txtLayerNumber').attr('max', $scope.totalLayers);
1003 1003 $('#layerChangeSlider').slider("option", "max", $scope.totalLayers);
1004   - // $('#layerChangeSlider').slider("option", "value",parseInt($scope.totalLayers)-parseInt($rootScope.layerNumber));
  1004 + // $('#layerChangeSlider').slider("option", "value",parseInt($scope.totalLayers)-parseInt($scope.layerNumber));
1005 1005  
1006 1006 $scope.one = 1;
1007 1007  
1008   - $scope.userInput = parseInt($rootScope.layerNumber);
  1008 + $scope.userInput = parseInt($scope.layerNumber);
1009 1009 $scope.skinTone = $rootScope.globalSetting.ethnicity;
1010 1010  
1011 1011 var SelectedLayerData = [];
1012 1012 SelectedLayerData = $rootScope.BodyLayerData.Layers.DataLayer[dataLength - $scope.userInput - 1];
1013 1013 if ((SelectedLayerData != null || SelectedLayerData != undefined))
1014 1014  
1015   - if ($rootScope.layerNumber == 0) {
1016   - console.log('lNo: ' + $rootScope.layerNumber + ' and BodyRegion.length: ' + SelectedLayerData.BodyRegion.length);
  1015 + if ($scope.layerNumber == 0) {
  1016 + console.log('lNo: ' + $scope.layerNumber + ' and BodyRegion.length: ' + SelectedLayerData.BodyRegion.length);
1017 1017  
1018 1018 if (SelectedLayerData.BodyRegion.length > 0) {
1019 1019 for (var z = 0; z < SelectedLayerData.BodyRegion.length; z++) {
... ... @@ -1024,7 +1024,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
1024 1024 if ($rootScope.viewOrientationId == 3 && bodyRegionId == 1) {
1025 1025 console.log('$rootScope.voId: ' + $rootScope.voId);
1026 1026 if (bodyRegion == bodyRegionId && bodyRegionSkinTone == 'W') {
1027   - return "content/images/DA/" + $scope.zoomInOut + "/body-views/" + $rootScope.voId + "/layers/" + $rootScope.layerNumber + "/" + bodyRegionId + "/W/" + SelectedLayerData.BodyRegion[z].Image._ImageName;
  1027 + return "content/images/DA/" + $scope.zoomInOut + "/body-views/" + $rootScope.voId + "/layers/" + $scope.layerNumber + "/" + bodyRegionId + "/W/" + SelectedLayerData.BodyRegion[z].Image._ImageName;
1028 1028 }
1029 1029 }
1030 1030  
... ... @@ -1032,7 +1032,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
1032 1032  
1033 1033 if (bodyRegion == bodyRegionId && bodyRegionSkinTone == $scope.skinTone) {
1034 1034  
1035   - return "content/images/DA/" + $scope.zoomInOut + "/body-views/" + $rootScope.voId + "/layers/" + $rootScope.layerNumber + "/" + bodyRegionId + "/" + $scope.skinTone + "/" + SelectedLayerData.BodyRegion[z].Image._ImageName;
  1035 + return "content/images/DA/" + $scope.zoomInOut + "/body-views/" + $rootScope.voId + "/layers/" + $scope.layerNumber + "/" + bodyRegionId + "/" + $scope.skinTone + "/" + SelectedLayerData.BodyRegion[z].Image._ImageName;
1036 1036 }
1037 1037 }
1038 1038 }
... ... @@ -1044,7 +1044,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
1044 1044 if (($rootScope.voId == '9') || ($rootScope.voId == '11') || ($rootScope.voId == '10') || ($rootScope.voId == '12')) {
1045 1045 var bodyRegion = SelectedLayerData.BodyRegion._BodyRegionId;
1046 1046  
1047   - return "content/images/DA/" + $scope.zoomInOut + "/body-views/" + $rootScope.voId + "/layers/" + $rootScope.layerNumber + "/" + bodyRegionId + "/" + SelectedLayerData.BodyRegion.Image._ImageName;
  1047 + return "content/images/DA/" + $scope.zoomInOut + "/body-views/" + $rootScope.voId + "/layers/" + $scope.layerNumber + "/" + bodyRegionId + "/" + SelectedLayerData.BodyRegion.Image._ImageName;
1048 1048  
1049 1049 }
1050 1050 else // it is for other body view which have multiple body regions and layer no > 0
... ... @@ -1055,7 +1055,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
1055 1055 var bodyRegion = SelectedLayerData.BodyRegion[z]._BodyRegionId;
1056 1056 if (bodyRegion == bodyRegionId) {
1057 1057  
1058   - return "content/images/DA/" + $scope.zoomInOut + "/body-views/" + $rootScope.voId + "/layers/" + $rootScope.layerNumber + "/" + bodyRegionId + "/" + SelectedLayerData.BodyRegion[z].Image._ImageName;
  1058 + return "content/images/DA/" + $scope.zoomInOut + "/body-views/" + $rootScope.voId + "/layers/" + $scope.layerNumber + "/" + bodyRegionId + "/" + SelectedLayerData.BodyRegion[z].Image._ImageName;
1059 1059  
1060 1060  
1061 1061 }
... ... @@ -2402,7 +2402,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
2402 2402 if (TransparencyBoxStartX <= bodyRegionRight && value.X <= transparencyBoxRight && TransparencyBoxStartY <= bodyRegionBottom && value.Y <= transparencyBoxBottom) {
2403 2403 //var transNumber = parseInt(document.getElementById("txtTransparencyChange").value);
2404 2404 // debugger;
2405   - $rootScope.layerNumber = parseInt(txtlayerNumber.value);
  2405 + $scope.layerNumber = parseInt(txtlayerNumber.value);
2406 2406  
2407 2407  
2408 2408 $scope.loadTransparencyImage(value.bodyRegionId, value.Height, value.Width, value.X, value.Y, value.IsMirror, TransparencyBoxStartX, transparencyBoxRight, TransparencyBoxStartY, transparencyBoxBottom, $scope, true, false);
... ... @@ -2418,7 +2418,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
2418 2418 if (parseInt($('#txtlayerNumber').val()) > (dataLength - 1)) {
2419 2419 $('#txtlayerNumber').val(dataLength - 1);
2420 2420 $scope.currentLayerNumber = parseInt(dataLength - 1);
2421   - $rootScope.layerNumber = parseInt(dataLength - 1);
  2421 + $scope.layerNumber = parseInt(dataLength - 1);
2422 2422 }
2423 2423 else
2424 2424 $scope.currentLayerNumber = parseInt($('#txtlayerNumber').val());
... ... @@ -2441,7 +2441,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
2441 2441 $timeout(function () { $scope.DisableProgressBar() }, 1000);
2442 2442 }
2443 2443  
2444   - $('#layerChangeSlider').slider("option", "value", parseInt($scope.totalLayers) - parseInt($rootScope.layerNumber));
  2444 + $('#layerChangeSlider').slider("option", "value", parseInt($scope.totalLayers) - parseInt($scope.layerNumber));
2445 2445 }
2446 2446  
2447 2447 $scope.DisableProgressBar = function () {
... ... @@ -3669,14 +3669,14 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
3669 3669 }
3670 3670 else if (isLayerChanged) {
3671 3671 // debugger
3672   - $rootScope.layerNumber = parseInt($('#txtlayerNumber').val());
  3672 + $scope.layerNumber = parseInt($('#txtlayerNumber').val());
3673 3673  
3674 3674 }
3675 3675 else {
3676 3676 var currentLayer = parseInt($('#txtlayerNumber').val());
3677 3677  
3678 3678 var tranparencyLayer = currentLayer + 1;
3679   - $rootScope.layerNumber = tranparencyLayer;
  3679 + $scope.layerNumber = tranparencyLayer;
3680 3680 }
3681 3681  
3682 3682 //dedebugger;
... ... @@ -3908,7 +3908,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
3908 3908 PreviousBodyRegionX = XforTransImage;
3909 3909 previousBodyRegionId = bodyRegionId;
3910 3910  
3911   - // $rootScope.layerNumber = parseInt($rootScope.layerNumber - 1);
  3911 + // $scope.layerNumber = parseInt($scope.layerNumber - 1);
3912 3912  
3913 3913 }
3914 3914  
... ... @@ -4407,7 +4407,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
4407 4407 }
4408 4408 //var scope = angular.element(document.getElementById("DAView")).scope();
4409 4409 //scope.$apply(function () {
4410   - // $rootScope.layerNumber = 0;
  4410 + // $scope.layerNumber = 0;
4411 4411 $scope.isTransparencyActivated = false;
4412 4412 //})
4413 4413  
... ... @@ -4421,7 +4421,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
4421 4421  
4422 4422 //$("canvas[name*='transparencyTempCanvas']").nextUntil($("canvas[name*='transparencyTempCanvas']"))
4423 4423 //.remove();
4424   - $rootScope.layerNumber = $scope.currentLayerNumber;
  4424 + $scope.layerNumber = $scope.currentLayerNumber;
4425 4425 $scope.transNumber = 50;
4426 4426 $(".slider").slider({ value: 50 })
4427 4427 }
... ... @@ -4504,6 +4504,11 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
4504 4504  
4505 4505 $scope.enableZoom = function () {
4506 4506  
  4507 + //$('#sppeachBubble_annotation').css('display', 'none');
  4508 +
  4509 + //$("#bord_annotation").css("display", "none");
  4510 + //$("#dot_annotation").css("display", "none");
  4511 +
4507 4512 $scope.terminateCurrentlyRunningWPs();
4508 4513  
4509 4514 if ($scope.isTransparencyActivated) {
... ... @@ -5361,7 +5366,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
5361 5366 }
5362 5367  
5363 5368 $rootScope.isViewChange = true;
5364   - $rootScope.layerNumber = 0;
  5369 + $scope.layerNumber = 0;
5365 5370 // debugger;
5366 5371 var selectedViewId = $scope.bodyViews[event.currentTarget.attributes[1].value];
5367 5372 $rootScope.viewOrientationId = selectedViewId;
... ... @@ -5499,9 +5504,9 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
5499 5504 //Reload DA controller Body View after setting Change
5500 5505 $scope.$on('reloadDABodyViewEvent', function (event, data) {
5501 5506 //console.log('reloadDABodyViewEvent');
5502   -
  5507 + $scope.layerNumber = parseInt($('#txtlayerNumber').val());
5503 5508 $scope.ReloadBodyViewId = data.reloadDABodyViewId;
5504   - // $rootScope.layerNumber = 0;
  5509 + // $scope.layerNumber = 0;
5505 5510 // debugger;
5506 5511  
5507 5512 console.log('reloadDABodyViewEvent ' + $scope.ReloadBodyViewId);
... ... @@ -6871,7 +6876,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
6871 6876 layerNumber = parseInt(layerNumber) - 1;
6872 6877 }
6873 6878  
6874   - $rootScope.layerNumber = layerNumber;
  6879 + $scope.layerNumber = layerNumber;
6875 6880  
6876 6881 //4.get scroll position
6877 6882 if (actualTermNumber != DA[0].SKIN_TERM_ID) {
... ... @@ -6912,8 +6917,8 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
6912 6917 }
6913 6918 }
6914 6919  
6915   - $('#txtlayerNumber').val((parseInt($rootScope.layerNumber)));
6916   - $('#layerChangeSlider').slider("option", "value", parseInt($scope.totalLayers) - parseInt($rootScope.layerNumber));
  6920 + $('#txtlayerNumber').val((parseInt($scope.layerNumber)));
  6921 + $('#layerChangeSlider').slider("option", "value", parseInt($scope.totalLayers) - parseInt($scope.layerNumber));
6917 6922  
6918 6923 //8.remove current layer canavses
6919 6924 $scope.flushCanvas();
... ...