Commit a96e4e234cd2b9d9423cbe7c584fa2b469a9c86f

Authored by Nikita Kulshreshtha
1 parent 748a5dd8

medial arm loading issue on settings change is fixed.

400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js
... ... @@ -23,7 +23,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
23 23 $scope.drawnBodyRegions;
24 24 //view specific constants
25 25 $rootScope.voId;
26   - $scope.layerNumber;
  26 + $rootScope.layerNumber;
27 27 $scope.daCounter = 1;
28 28 $scope.bagartDetails;
29 29 $scope.transNumber = 50;
... ... @@ -623,7 +623,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
623 623  
624 624 $rootScope.isNormalMode = true;
625 625  
626   - $scope.layerNumber = 0;
  626 + $rootScope.layerNumber = 0;
627 627 $scope.skinTone = $rootScope.globalSetting.ethnicity;
628 628  
629 629 $rootScope.viewOrientationId = $rootScope.voId;
... ... @@ -721,6 +721,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
721 721 {
722 722 angular.forEach($scope.bodyRegionCoordinates, function (value, key)
723 723 {
  724 + console.log('$scope.bodyRegionCoordinates length= ' + $scope.bodyRegionCoordinates.length)
724 725  
725 726 if (value._HaveMirrorImage == 'Y') {
726 727  
... ... @@ -841,7 +842,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
841 842  
842 843 if ((dtlOfSktn != null || dtlOfSktn != undefined) && (dtlOfSktn.length > 0)) {
843 844  
844   - if ((parseInt(dtlOfSktn[0]._lns) <= parseInt($scope.layerNumber)) && (parseInt(dtlOfSktn[0]._lne) > parseInt($scope.layerNumber)) && (dtlOfSktn[0]._isfr == 'Y')) {
  845 + if ((parseInt(dtlOfSktn[0]._lns) <= parseInt($rootScope.layerNumber)) && (parseInt(dtlOfSktn[0]._lne) > parseInt($rootScope.layerNumber)) && (dtlOfSktn[0]._isfr == 'Y')) {
845 846 $scope.figLaefImageName = dtlOfSktn[0]._ImageId;
846 847 //$scope.figLaefX = filtereddata[0]._X;
847 848 //$scope.figLaefY = filtereddata[0]._Y;
... ... @@ -896,7 +897,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
896 897 $('#canvasDiv').scrollTop(50)
897 898 var abc = $rootScope.BodyRegionCordinatesData;
898 899 //debugger;
899   - $('#layerChangeSlider').slider("option", "value", parseInt($scope.totalLayers) - parseInt($scope.layerNumber));
  900 + $('#layerChangeSlider').slider("option", "value", parseInt($scope.totalLayers) - parseInt($rootScope.layerNumber));
900 901 // $('#spinner').css('visibility', 'hidden');
901 902 $rootScope.isLoading = false;
902 903 //Dated:16-07-2016 Issue #4957 :While selecting the Zoom-in\Zoom-out button scroll should be go on top.
... ... @@ -995,18 +996,18 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
995 996 // debugger
996 997 $('#txtLayerNumber').attr('max', $scope.totalLayers);
997 998 $('#layerChangeSlider').slider("option", "max", $scope.totalLayers);
998   - // $('#layerChangeSlider').slider("option", "value",parseInt($scope.totalLayers)-parseInt($scope.layerNumber));
  999 + // $('#layerChangeSlider').slider("option", "value",parseInt($scope.totalLayers)-parseInt($rootScope.layerNumber));
999 1000  
1000 1001 $scope.one = 1;
1001 1002  
1002   - $scope.userInput = parseInt($scope.layerNumber);
  1003 + $scope.userInput = parseInt($rootScope.layerNumber);
1003 1004 $scope.skinTone = $rootScope.globalSetting.ethnicity;
1004 1005  
1005 1006 var SelectedLayerData = [];
1006 1007 SelectedLayerData = $rootScope.BodyLayerData.Layers.DataLayer[dataLength - $scope.userInput - 1];
1007 1008 if ((SelectedLayerData != null || SelectedLayerData != undefined))
1008 1009  
1009   - if ($scope.layerNumber == 0) {
  1010 + if ($rootScope.layerNumber == 0) {
1010 1011 if (SelectedLayerData.BodyRegion.length > 0) {
1011 1012 for (var z = 0; z < SelectedLayerData.BodyRegion.length; z++) {
1012 1013  
... ... @@ -1015,7 +1016,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
1015 1016  
1016 1017 if (bodyRegion == bodyRegionId && bodyRegionSkinTone == $scope.skinTone) {
1017 1018  
1018   - return "content/images/DA/" + $scope.zoomInOut + "/body-views/" + $rootScope.voId + "/layers/" + $scope.layerNumber + "/" + bodyRegionId + "/" + $scope.skinTone + "/" + SelectedLayerData.BodyRegion[z].Image._ImageName;
  1019 + return "content/images/DA/" + $scope.zoomInOut + "/body-views/" + $rootScope.voId + "/layers/" + $rootScope.layerNumber + "/" + bodyRegionId + "/" + $scope.skinTone + "/" + SelectedLayerData.BodyRegion[z].Image._ImageName;
1019 1020 }
1020 1021 }
1021 1022 }
... ... @@ -1026,7 +1027,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
1026 1027 if (($rootScope.voId == '9') || ($rootScope.voId == '11') || ($rootScope.voId == '10') || ($rootScope.voId == '12')) {
1027 1028 var bodyRegion = SelectedLayerData.BodyRegion._BodyRegionId;
1028 1029  
1029   - return "content/images/DA/" + $scope.zoomInOut + "/body-views/" + $rootScope.voId + "/layers/" + $scope.layerNumber + "/" + bodyRegionId + "/" + SelectedLayerData.BodyRegion.Image._ImageName;
  1030 + return "content/images/DA/" + $scope.zoomInOut + "/body-views/" + $rootScope.voId + "/layers/" + $rootScope.layerNumber + "/" + bodyRegionId + "/" + SelectedLayerData.BodyRegion.Image._ImageName;
1030 1031  
1031 1032 }
1032 1033 else // it is for other body view which have multiple body regions and layer no > 0
... ... @@ -1037,7 +1038,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
1037 1038 var bodyRegion = SelectedLayerData.BodyRegion[z]._BodyRegionId;
1038 1039 if (bodyRegion == bodyRegionId) {
1039 1040  
1040   - return "content/images/DA/" + $scope.zoomInOut + "/body-views/" + $rootScope.voId + "/layers/" + $scope.layerNumber + "/" + bodyRegionId + "/" + SelectedLayerData.BodyRegion[z].Image._ImageName;
  1041 + return "content/images/DA/" + $scope.zoomInOut + "/body-views/" + $rootScope.voId + "/layers/" + $rootScope.layerNumber + "/" + bodyRegionId + "/" + SelectedLayerData.BodyRegion[z].Image._ImageName;
1041 1042  
1042 1043  
1043 1044 }
... ... @@ -2376,7 +2377,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
2376 2377 if (TransparencyBoxStartX <= bodyRegionRight && value.X <= transparencyBoxRight && TransparencyBoxStartY <= bodyRegionBottom && value.Y <= transparencyBoxBottom) {
2377 2378 //var transNumber = parseInt(document.getElementById("txtTransparencyChange").value);
2378 2379 // debugger;
2379   - $scope.layerNumber = parseInt(txtlayerNumber.value);
  2380 + $rootScope.layerNumber = parseInt(txtlayerNumber.value);
2380 2381  
2381 2382  
2382 2383 $scope.loadTransparencyImage(value.bodyRegionId, value.Height, value.Width, value.X, value.Y, value.IsMirror, TransparencyBoxStartX, transparencyBoxRight, TransparencyBoxStartY, transparencyBoxBottom, $scope, true, false);
... ... @@ -2392,7 +2393,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
2392 2393 if (parseInt($('#txtlayerNumber').val()) > (dataLength - 1)) {
2393 2394 $('#txtlayerNumber').val(dataLength - 1);
2394 2395 $scope.currentLayerNumber = parseInt(dataLength - 1);
2395   - $scope.layerNumber = parseInt(dataLength - 1);
  2396 + $rootScope.layerNumber = parseInt(dataLength - 1);
2396 2397 }
2397 2398 else
2398 2399 $scope.currentLayerNumber = parseInt($('#txtlayerNumber').val());
... ... @@ -2415,7 +2416,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
2415 2416 $timeout(function () { $scope.DisableProgressBar() }, 1000);
2416 2417 }
2417 2418  
2418   - $('#layerChangeSlider').slider("option", "value", parseInt($scope.totalLayers) - parseInt($scope.layerNumber));
  2419 + $('#layerChangeSlider').slider("option", "value", parseInt($scope.totalLayers) - parseInt($rootScope.layerNumber));
2419 2420 }
2420 2421  
2421 2422 $scope.DisableProgressBar = function () {
... ... @@ -3641,14 +3642,14 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
3641 3642 }
3642 3643 else if (isLayerChanged) {
3643 3644 // debugger
3644   - $scope.layerNumber = parseInt($('#txtlayerNumber').val());
  3645 + $rootScope.layerNumber = parseInt($('#txtlayerNumber').val());
3645 3646  
3646 3647 }
3647 3648 else {
3648 3649 var currentLayer = parseInt($('#txtlayerNumber').val());
3649 3650  
3650 3651 var tranparencyLayer = currentLayer + 1;
3651   - $scope.layerNumber = tranparencyLayer;
  3652 + $rootScope.layerNumber = tranparencyLayer;
3652 3653 }
3653 3654  
3654 3655 //dedebugger;
... ... @@ -3880,7 +3881,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
3880 3881 PreviousBodyRegionX = XforTransImage;
3881 3882 previousBodyRegionId = bodyRegionId;
3882 3883  
3883   - // $scope.layerNumber = parseInt($scope.layerNumber - 1);
  3884 + // $rootScope.layerNumber = parseInt($rootScope.layerNumber - 1);
3884 3885  
3885 3886 }
3886 3887  
... ... @@ -4379,7 +4380,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
4379 4380 }
4380 4381 //var scope = angular.element(document.getElementById("DAView")).scope();
4381 4382 //scope.$apply(function () {
4382   - // $scope.layerNumber = 0;
  4383 + // $rootScope.layerNumber = 0;
4383 4384 $scope.isTransparencyActivated = false;
4384 4385 //})
4385 4386  
... ... @@ -4393,7 +4394,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
4393 4394  
4394 4395 //$("canvas[name*='transparencyTempCanvas']").nextUntil($("canvas[name*='transparencyTempCanvas']"))
4395 4396 //.remove();
4396   - $scope.layerNumber = $scope.currentLayerNumber;
  4397 + $rootScope.layerNumber = $scope.currentLayerNumber;
4397 4398 $scope.transNumber = 50;
4398 4399 $(".slider").slider({ value: 50 })
4399 4400 }
... ... @@ -5309,7 +5310,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
5309 5310 $('#spinner').css('visibility', 'visible');
5310 5311  
5311 5312 $rootScope.isViewChange = true;
5312   - $scope.layerNumber = 0;
  5313 + $rootScope.layerNumber = 0;
5313 5314 // debugger;
5314 5315 var selectedViewId = $scope.bodyViews[event.currentTarget.attributes[1].value];
5315 5316 $rootScope.viewOrientationId = selectedViewId;
... ... @@ -5449,9 +5450,9 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
5449 5450 //console.log('reloadDABodyViewEvent');
5450 5451  
5451 5452 $scope.ReloadBodyViewId = data.reloadDABodyViewId;
5452   - // $scope.layerNumber = 0;
  5453 + // $rootScope.layerNumber = 0;
5453 5454 // debugger;
5454   -
  5455 + var layerNumber = $rootScope.layerNumber
5455 5456 console.log('reloadDABodyViewEvent ' + $scope.ReloadBodyViewId);
5456 5457  
5457 5458 if ($rootScope.isSettingEventAlredayDispachted == true) {
... ... @@ -6775,7 +6776,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
6775 6776 layerNumber = parseInt(layerNumber) - 1;
6776 6777 }
6777 6778  
6778   - $scope.layerNumber = layerNumber;
  6779 + $rootScope.layerNumber = layerNumber;
6779 6780  
6780 6781 //4.get scroll position
6781 6782 if (actualTermNumber != DA[0].SKIN_TERM_ID) {
... ... @@ -6816,8 +6817,8 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
6816 6817 }
6817 6818 }
6818 6819  
6819   - $('#txtlayerNumber').val((parseInt($scope.layerNumber)));
6820   - $('#layerChangeSlider').slider("option", "value", parseInt($scope.totalLayers) - parseInt($scope.layerNumber));
  6820 + $('#txtlayerNumber').val((parseInt($rootScope.layerNumber)));
  6821 + $('#layerChangeSlider').slider("option", "value", parseInt($scope.totalLayers) - parseInt($rootScope.layerNumber));
6821 6822  
6822 6823 //8.remove current layer canavses
6823 6824 $scope.flushCanvas();
... ...