diff --git a/400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js b/400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js index b93d510..2c88b74 100644 --- a/400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js +++ b/400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js @@ -89,7 +89,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo //navigator man functionality $scope.navigatorImage; - $scope.NavigatorData; + $rootScope.NavigatorData; $scope.navimgsrc; $scope.dragdivleft = 0; @@ -666,12 +666,12 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo $http({ method: 'GET', url: NavigatorManJsonPath }) .success(function (data) { - $scope.NavigatorData = data; + $rootScope.NavigatorData = data; $scope.skinTone = $rootScope.globalSetting.ethnicity; var navigatorManData = new jinqJs() - .from($scope.NavigatorData.Navigtor.ViewOrientation) + .from($rootScope.NavigatorData.Navigtor.ViewOrientation) .where("_ViewOrientationId == " + $rootScope.currentBodyViewId) .select(); @@ -706,7 +706,8 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo navImageModesty = $scope.navigatorImage[0]._ImageName; } - $scope.navimgsrc = "~/../content/images/DA/ethnicity/body-views/" + $scope.voId + '/' + $scope.skinTone + '/navigator_images/' + navImageModesty; + // $scope.navimgsrc = "~/../content/images/DA/ethnicity/body-views/" + $scope.voId + '/' + $scope.skinTone + '/navigator_images/' + navImageModesty; + document.getElementById('navimg').src = "~/../content/images/DA/ethnicity/body-views/" + $scope.voId + '/' + $scope.skinTone + '/navigator_images/' + navImageModesty; $('#navigatorDiv').css('visibility', 'visible'); @@ -6758,20 +6759,28 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo }) + $scope.$on('changeNavigatorModestyEvent', function (event, data) { + console.log('changeNavigatorModestyEvent'); + + $scope.loadSelectedBodyViewNavigator(data.bodyViewId); + + }) //Reload DA controller Body View after setting Change $scope.$on('reloadDABodyViewEvent', function (event, data) { //console.log('reloadDABodyViewEvent'); - $scope.layerNumber = parseInt($('#txtlayerNumber').val()); - //alert('mouseUp'); + if ($rootScope.isSettingEventAlredayDispachted == true) { + $rootScope.isSettingEventAlredayDispachted = false; + $scope.layerNumber = parseInt($('#txtlayerNumber').val()); + //alert('mouseUp'); - if ($scope.layerNumber == 0) { - $scope.loadSelectedBodyView(data.reloadDABodyViewId); - } - // $scope.loadSelectedBodyView(data.reloadDABodyViewId); - - $scope.loadSelectedBodyViewNavigator(data.reloadDABodyViewId); + if ($scope.layerNumber == 0) { + $scope.loadSelectedBodyView(data.reloadDABodyViewId); + } + // $scope.loadSelectedBodyView(data.reloadDABodyViewId); + $scope.loadSelectedBodyViewNavigator(data.reloadDABodyViewId); + } // $scope.currentTitleFromJson = localStorage.getItem("currentViewTitle"); //$rootScope.isSettingEventAlredayDispachted = false; @@ -6779,17 +6788,15 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo }) - - $scope.loadSelectedBodyViewNavigator = function (currentBodyViewId) { //$rootScope.voId = currentBodyViewId; //$scope.skinTone = $rootScope.globalSetting.ethnicity; - if ($scope.NavigatorData != null || $scope.NavigatorData != undefined) { + if ($rootScope.NavigatorData != null || $rootScope.NavigatorData != undefined) { var navdtlOrient = new jinqJs() - .from($scope.NavigatorData.Navigtor.ViewOrientation) + .from($rootScope.NavigatorData.Navigtor.ViewOrientation) .where("_ViewOrientationId == " + currentBodyViewId) .select(); @@ -6819,7 +6826,8 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo } - $scope.navimgsrc = "~/../content/images/DA/ethnicity/body-views/" + $scope.voId + '/' + $rootScope.globalSetting.ethnicity + '/navigator_images/' + navImageModesty; + // $scope.navimgsrc = 'http://localhost/AIAHTML5/content/images/DA/ethnicity/body-views/' + $scope.voId + '/' + $rootScope.globalSetting.ethnicity + '/navigator_images/' + navImageModesty;//"~/../content/images/DA/ethnicity/body-views/" + $scope.voId + '/' + $rootScope.globalSetting.ethnicity + '/navigator_images/' + navImageModesty; + document.getElementById('navimg').src = '~/../content/images/DA/ethnicity/body-views/' + $scope.voId + '/' + $rootScope.globalSetting.ethnicity + '/navigator_images/' + navImageModesty;//"~/../content/images/DA/ethnicity/body-views/" + $scope.voId + '/' + $rootScope.globalSetting.ethnicity + '/navigator_images/' + navImageModesty; } } diff --git a/400-SOURCECODE/AIAHTML5.Web/app/controllers/HomeController.js b/400-SOURCECODE/AIAHTML5.Web/app/controllers/HomeController.js index 9943597..539b935 100644 --- a/400-SOURCECODE/AIAHTML5.Web/app/controllers/HomeController.js +++ b/400-SOURCECODE/AIAHTML5.Web/app/controllers/HomeController.js @@ -1953,7 +1953,7 @@ AIA.controller("HomeController", ["$rootScope", "Modules", "$log", "$location", } } - + $rootScope.prevId = ""; } function fillListManagerTerms() { @@ -2073,30 +2073,63 @@ AIA.controller("HomeController", ["$rootScope", "Modules", "$log", "$location", }; $rootScope.UpdateSetting = function (setting) { - + var isReloadingViewRequired = false; //1. if (typeof (setting.ethnicity) !== "undefined" && setting.ethnicity !== null) { $rootScope.ChangeEthnicity(setting, setting.ethnicity); - $rootScope.globalSetting.ethnicity = setting.ethnicity; - localStorage.setItem("globalEthnicity", $rootScope.globalSetting.ethnicity); - $rootScope.setEthncitySettings($rootScope.globalSetting.ethnicity); - } + } if (typeof (setting.modesty) !== "undefined" && setting.modesty !== null) { $rootScope.ChangeModesty(setting, setting.modesty); - $rootScope.globalSetting.modesty = setting.modesty; - localStorage.setItem("globalModesty", $rootScope.globalSetting.modesty); - $rootScope.setModestySettings($rootScope.globalSetting.modesty); } //2. - - var len = $rootScope.openModules.length; - if (len > 0) { - $rootScope.reloadChildController(); + if((setting.ethnicity!=null && setting.ethnicity!= $rootScope.globalSetting.ethnicity) && (setting.modesty!=null && setting.modesty != $rootScope.globalSetting.modesty) ){ + $rootScope.globalSetting.ethnicity = setting.ethnicity; + localStorage.setItem("globalEthnicity", $rootScope.globalSetting.ethnicity); + + $rootScope.globalSetting.modesty = setting.modesty; + localStorage.setItem("globalModesty", setting.modesty); + + isReloadingViewRequired = true; + } - else { - $('#modal-settings').modal('hide'); + + else if (setting.ethnicity!=null && setting.ethnicity != $rootScope.globalSetting.ethnicity) { + + $rootScope.globalSetting.ethnicity = setting.ethnicity; + localStorage.setItem("globalEthnicity", $rootScope.globalSetting.ethnicity); + + $rootScope.globalSetting.modesty = localStorage.getItem("globalModesty"); + + isReloadingViewRequired = true; } + else if (setting.modesty!= null && setting.modesty != $rootScope.globalSetting.modesty) { + $rootScope.globalSetting.modesty = setting.modesty; + localStorage.setItem("globalModesty", $rootScope.globalSetting.modesty); + + $rootScope.globalSetting.ethnicity = localStorage.getItem("globalEthnicity"); + + if ($('.modestyImg') != null) { + if (($rootScope.globalSetting.modesty == 'Y')) { + $('.modestyImg').css('visibility', 'visible'); + } + + else { + $('.modestyImg').css('visibility', 'hidden'); + } + } + $rootScope.changeNavigatorModesty(); + } + + var len = $rootScope.openModules.length; + if (len > 0) { + if (isReloadingViewRequired == true) { + $rootScope.reloadChildController(); + } + } + else { + $('#modal-settings').modal('hide'); + } }; @@ -2171,8 +2204,8 @@ AIA.controller("HomeController", ["$rootScope", "Modules", "$log", "$location", //Check that what current bodyview is open if ($rootScope.openViews.length > 0) { var openViewLen = $rootScope.openViews.length; - var currentOpenViewId = $rootScope.openViews[openViewLen - 1].BodyViewId; - //$rootScope.isSettingEventAlredayDispachted = true; + var currentOpenViewId = localStorage.getItem("currentBodyViewId");//$rootScope.openViews[openViewLen - 1].BodyViewId; + $rootScope.isSettingEventAlredayDispachted = true; $rootScope.$broadcast('reloadDABodyViewEvent', { reloadDABodyViewId: currentOpenViewId }, true); } else { @@ -2182,6 +2215,11 @@ AIA.controller("HomeController", ["$rootScope", "Modules", "$log", "$location", } }; + $rootScope.changeNavigatorModesty = function () { + var currentOpenViewId = localStorage.getItem("currentBodyViewId");//$rootScope.openViews[openViewLen - 1].BodyViewId; + $rootScope.$broadcast('changeNavigatorModestyEvent', { bodyViewId: currentOpenViewId }, true); + + }; }] ); \ No newline at end of file diff --git a/400-SOURCECODE/AIAHTML5.Web/app/views/da/da-view.html b/400-SOURCECODE/AIAHTML5.Web/app/views/da/da-view.html index 5934b62..dc1e55f 100644 --- a/400-SOURCECODE/AIAHTML5.Web/app/views/da/da-view.html +++ b/400-SOURCECODE/AIAHTML5.Web/app/views/da/da-view.html @@ -313,7 +313,7 @@