Commit ff55d372506c8edb0c8dc59391b634612599ab6c

Authored by Amrita Vishnoi
1 parent ad1243e3

Navigator man defect fix:

Navigator man image is switching on geneder/ body view switch.
400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js
... ... @@ -4666,10 +4666,15 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
4666 4666  
4667 4667 if ((event.currentTarget.attributes[1].value == 'Male') && (localStorage.getItem("genderId") == 'Female')) {
4668 4668  
  4669 + //1.
4669 4670 localStorage.setItem("genderId", 'Male');
  4671 +
  4672 + //2.
  4673 + $scope.loadSelectedBodyView(currentBodyViewId);
4670 4674  
  4675 + //3.
  4676 + $scope.loadSelectedBodyViewNavigator(currentBodyViewId);
4671 4677  
4672   - $scope.loadSelectedBodyView(currentBodyViewId);
4673 4678  
4674 4679 $('#daImagePanel')[0].childNodes[0].childNodes[0].innerHTML = localStorage.getItem("currentViewTitle").replace('Female', 'Male');
4675 4680 $rootScope.isLoading = true;
... ... @@ -4680,8 +4685,13 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
4680 4685  
4681 4686 localStorage.setItem("genderId", 'Female');
4682 4687  
  4688 + //1.
  4689 + $scope.loadSelectedBodyView(currentBodyViewId);
  4690 +
  4691 + //2.
  4692 + $scope.loadSelectedBodyViewNavigator(currentBodyViewId);
4683 4693  
4684   - $scope.loadSelectedBodyView(currentBodyViewId)
  4694 + //3.
4685 4695 $('#daImagePanel')[0].childNodes[0].childNodes[0].innerHTML = localStorage.getItem("currentViewTitle").replace('Male', 'Female');
4686 4696  
4687 4697 $rootScope.isLoading = true;
... ... @@ -4796,7 +4806,12 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
4796 4806 $rootScope.voId = selectedViewId;
4797 4807 $rootScope.isLoading = true;
4798 4808  
  4809 + //1. Load selected body view
4799 4810 $scope.loadSelectedBodyView($rootScope.voId);
  4811 +
  4812 + //2. load corresponding navigator man
  4813 + $scope.loadSelectedBodyViewNavigator($rootScope.voId);
  4814 +
4800 4815 };
4801 4816  
4802 4817  
... ... @@ -4817,7 +4832,11 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
4817 4832 $rootScope.voId = selectedViewId;
4818 4833 $rootScope.isLoading = true;
4819 4834  
  4835 + //1.
4820 4836 $scope.loadSelectedBodyView($rootScope.voId);
  4837 +
  4838 + //2.
  4839 + $scope.loadSelectedBodyViewNavigator($rootScope.voId);
4821 4840 };
4822 4841  
4823 4842  
... ... @@ -4887,6 +4906,43 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
4887 4906 }
4888 4907 }
4889 4908  
  4909 + $scope.loadSelectedBodyViewNavigator = function (currentBodyViewId) {
  4910 +
  4911 + $rootScope.voId = currentBodyViewId;
  4912 +
  4913 + $scope.skinTone = DA[0].ethnicity;
  4914 +
  4915 + var navdtlOrient = new jinqJs()
  4916 + .from($scope.NavigatorData.Navigtor.ViewOrientation)
  4917 + .where("_ViewOrientationId == " + $scope.voId)
  4918 + .select();
  4919 + //console.log(navdtlOrient);
  4920 + //console.log(navdtlOrient[0].ImageInfo);
  4921 + var navOrientationdata = new jinqJs()
  4922 + .from(navdtlOrient[0].ImageInfo)
  4923 + .where("_Ethnicity == " + $scope.skinTone)
  4924 + .select();
  4925 + //console.log(navOrientationdata);
  4926 +
  4927 + $scope.NavOrientationdata = navOrientationdata;
  4928 + //console.log("$scope.NavOrientationdata: ");
  4929 + //console.log($scope.NavOrientationdata);
  4930 +
  4931 + var navimagemodesty;
  4932 +
  4933 + angular.forEach($scope.NavOrientationdata, function (value, key) {
  4934 + if (value._HaveModesty === DA[0].modesty) {
  4935 + navimagemodesty = value._ImageName;
  4936 + }
  4937 + })
  4938 + if (typeof (navimagemodesty) === "undefined" || navimagemodesty === null) {
  4939 +
  4940 + navimagemodesty = $scope.NavOrientationdata[0]._ImageName;
  4941 +
  4942 + }
  4943 +
  4944 + $scope.navimgsrc = "~/../content/images/DA/ethnicity/body-views/" + $scope.voId + '/' + $scope.skinTone + '/navigator_images/' + navimagemodesty;
  4945 + }
4890 4946  
4891 4947 //Annotation tool event lsitener
4892 4948 $scope.$on('annotationToolEvent', function (event, data) {
... ...