Commit 9223e6d0abd5c89b358a271441cf2c33ea20f0db

Authored by Nikita Kulshreshtha
1 parent efbff961

started gender change functionality implementation for DA toolbar gender button

400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js
... ... @@ -26,6 +26,25 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
26 26 $scope.TBDrawStartX;
27 27 $scope.TBDrawStartY;
28 28  
  29 +
  30 + //array for bodyviewid correspoing to male female(used for gender change)
  31 + $scope.correspondingBodyViewIds = {
  32 + '1': '5',
  33 + '2': '6',
  34 + '3': '7',
  35 + '4': '8',
  36 + '9': '11',
  37 + '10': '12',
  38 +
  39 + '5': '1',
  40 + '6': '2',
  41 + '7': '3',
  42 + '8': '4',
  43 + '11': '9',
  44 + '12': '10',
  45 +
  46 + }
  47 +
29 48 $scope.isBodylayerdataLoaded = false;
30 49 $scope.isBodyRegionDataLoaded = false;
31 50 $scope.showme = false;
... ... @@ -201,20 +220,9 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
201 220 var layerJsonPath = '';
202 221 var bgArtJsonPath = '';
203 222 var CommonViewId = 0;
204   - //get layer data for body view
205   - //if (currentBodyViewId == 12) {
206   - // CommonViewId = 10;
207   - // layerJsonPath = '~/../content/data/json/da/bodyView/' + CommonViewId + '/da_dat_layer_' + CommonViewId + '.json';
208   - //}
209   - //else if (currentBodyViewId == 11)
210   - //{
211   - // CommonViewId = 9;
212   - // layerJsonPath = '~/../content/data/json/da/bodyView/' + CommonViewId + '/da_dat_layer_' + CommonViewId + '.json';
213   - //}
214   - //else
215   - //{
  223 +
216 224 layerJsonPath = '~/../content/data/json/da/bodyView/' + currentBodyViewId + '/da_dat_layer_' + currentBodyViewId + '.json';
217   - //}
  225 +
218 226  
219 227  
220 228 DataService.getAnotherJson(layerJsonPath)
... ... @@ -2478,6 +2486,47 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
2478 2486 }
2479 2487  
2480 2488  
  2489 + $scope.OnGenderChange = function (event) {
  2490 + debugger;
  2491 + //use $scope.correspondingBodyViewIds for getting correspnding viewid
  2492 + alert('gender changed= ' + event.currentTarget.attributes[1].value)
  2493 + if (event.currentTarget.attributes[1].value == 'Male') {
  2494 + if (localStorage.getItem("genderId") == 'Male') {
  2495 +
  2496 + }
  2497 + else {
  2498 + switch ($scope.voId) {
  2499 + case 1:
  2500 + $scope.voId = 5;
  2501 + break;
  2502 + }
  2503 +
  2504 + $scope.CalculateImageCordinates($scope.viewOrientationId)
  2505 + }
  2506 + }
  2507 + else if (event.currentTarget.attributes[1].value == 'Female') {
  2508 + if (localStorage.getItem("genderId") == 'Male') {
  2509 + switch ($scope.voId) {
  2510 + case "1":
  2511 + $scope.voId = "5";
  2512 + break;
  2513 + }
  2514 +
  2515 + var canDiv = document.getElementById('canvasDiv');
  2516 + var canDivChildCount = canDiv.childElementCount;
  2517 + if (canDivChildCount > 0) {
  2518 + canDiv.innerHTML = '';
  2519 + }
  2520 + //load corresponding json files
  2521 +
  2522 + $scope.CalculateImageCordinates($scope.viewOrientationId)
  2523 +
  2524 + }
  2525 + else {
  2526 + }
  2527 + }
  2528 + }
  2529 +
2481 2530 }]
2482 2531  
2483 2532  
... ...
400-SOURCECODE/AIAHTML5.Web/app/views/da/da-view.html
... ... @@ -57,8 +57,8 @@
57 57 <div class="col-sm-6" title="Gender">
58 58 <button class="btn btn-black btn-sm marginTop5 dropdown-toggle" type="button" id="dropdownMenu4" data-toggle="dropdown" aria-haspopup="true" aria-expanded="true"> <i class=" fa fa-intersex font16"></i></button>
59 59 <ul class="dropdown-menu" aria-labelledby="dropdownMenu3">
60   - <li><a href="#" title="Male">Male</a></li>
61   - <li><a href="#" title="Female">Female</a></li>
  60 + <li><a href="#" title="Male" ng-click="OnGenderChange($event)">Male</a></li>
  61 + <li><a href="#" title="Female" ng-click="OnGenderChange($event)">Female</a></li>
62 62 </ul>
63 63 </div>
64 64 <div class="col-sm-6" title="View">
... ...