diff --git a/400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js b/400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js index 325e6ca..89bf757 100644 --- a/400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js +++ b/400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js @@ -54,7 +54,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo // $scope.AnteriorView = "active"; - $scope.zoomInOut = 75; + $rootScope.zoomInOut = 75; $scope.speechBubbleCounter = 0; $scope.j = 0; $scope.speechbubbleList = []; @@ -251,7 +251,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo } - $scope.imagePath = "~/../content/images/DA/" + $scope.zoomInOut + "/body-views/" + value._id + '/skintone/' + userEthnicity + '/' + thumbnailImage; + $scope.imagePath = "~/../content/images/DA/" + $rootScope.zoomInOut + "/body-views/" + value._id + '/skintone/' + userEthnicity + '/' + thumbnailImage; var $el = $('
' @@ -968,6 +968,9 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo } + if (localStorage.getItem("zoomInOutValue")!=undefined) + $rootScope.zoomInOut = localStorage.getItem("zoomInOutValue"); + if ($scope.bodyRegionCoordinates != null || $scope.bodyRegionCoordinates != undefined) { angular.forEach($scope.bodyRegionCoordinates, function (value, key) { @@ -1102,7 +1105,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo var rectangle = scaleRectangle(value._X, value._Y, value._Height, value._Width, value._MirrorValue); - var src = "content/images/DA/" + $scope.zoomInOut + "/body-views/" + $rootScope.voId + "/layers/0/" + value._BodyRegionId + "/" + $scope.figLaefImageName; + var src = "content/images/DA/" + $rootScope.zoomInOut + "/body-views/" + $rootScope.voId + "/layers/0/" + value._BodyRegionId + "/" + $scope.figLaefImageName; $scope.DrawImage(rectangle.scaledHeight, rectangle.scaledWidth, rectangle.scaledX, rectangle.scaledY, src, 'modestyImg' + value._BodyRegionId, 'N') @@ -1199,7 +1202,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo } function scaleRectangle(x, y, height, width, mirrorValue) { - var nzoom = $scope.zoomInOut; + var nzoom = $rootScope.zoomInOut; var existingZoon = 100; var X = 0; @@ -1288,7 +1291,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo if ($rootScope.viewOrientationId == 3 && bodyRegionId == 1) { console.log('$rootScope.voId: ' + $rootScope.voId); if (bodyRegion == bodyRegionId && bodyRegionSkinTone == 'W') { - return "content/images/DA/" + $scope.zoomInOut + "/body-views/" + $rootScope.voId + "/layers/" + $scope.layerNumber + "/" + bodyRegionId + "/W/" + SelectedLayerData.BodyRegion[z].Image._ImageName; + return "content/images/DA/" + $rootScope.zoomInOut + "/body-views/" + $rootScope.voId + "/layers/" + $scope.layerNumber + "/" + bodyRegionId + "/W/" + SelectedLayerData.BodyRegion[z].Image._ImageName; } } @@ -1296,7 +1299,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo if (bodyRegion == bodyRegionId && bodyRegionSkinTone == $scope.skinTone) { - return "content/images/DA/" + $scope.zoomInOut + "/body-views/" + $rootScope.voId + "/layers/" + $scope.layerNumber + "/" + bodyRegionId + "/" + $scope.skinTone + "/" + SelectedLayerData.BodyRegion[z].Image._ImageName; + return "content/images/DA/" + $rootScope.zoomInOut + "/body-views/" + $rootScope.voId + "/layers/" + $scope.layerNumber + "/" + bodyRegionId + "/" + $scope.skinTone + "/" + SelectedLayerData.BodyRegion[z].Image._ImageName; } } } @@ -1308,7 +1311,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo if (($rootScope.voId == '9') || ($rootScope.voId == '11') || ($rootScope.voId == '10') || ($rootScope.voId == '12')) { var bodyRegion = SelectedLayerData.BodyRegion._BodyRegionId; - return "content/images/DA/" + $scope.zoomInOut + "/body-views/" + $rootScope.voId + "/layers/" + $scope.layerNumber + "/" + bodyRegionId + "/" + SelectedLayerData.BodyRegion.Image._ImageName; + return "content/images/DA/" + $rootScope.zoomInOut + "/body-views/" + $rootScope.voId + "/layers/" + $scope.layerNumber + "/" + bodyRegionId + "/" + SelectedLayerData.BodyRegion.Image._ImageName; } else // it is for other body view which have multiple body regions and layer no > 0 @@ -1319,7 +1322,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo var bodyRegion = SelectedLayerData.BodyRegion[z]._BodyRegionId; if (bodyRegion == bodyRegionId) { - return "content/images/DA/" + $scope.zoomInOut + "/body-views/" + $rootScope.voId + "/layers/" + $scope.layerNumber + "/" + bodyRegionId + "/" + SelectedLayerData.BodyRegion[z].Image._ImageName; + return "content/images/DA/" + $rootScope.zoomInOut + "/body-views/" + $rootScope.voId + "/layers/" + $scope.layerNumber + "/" + bodyRegionId + "/" + SelectedLayerData.BodyRegion[z].Image._ImageName; } @@ -1361,13 +1364,13 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo for (var z = 0; z <= $scope.bagartDetailsOnSktn.length; z++) { var gender = $scope.bagartDetailsOnSktn[z]._Gender; if (gender == selectedGender) { - return "content/images/DA/" + $scope.zoomInOut + "/body-views/" + $rootScope.voId + "/layers/0/" + bodyRegionId + "/" + $scope.skinTone + "/" + $scope.bagartDetailsOnSktn[z]._ImageId; + return "content/images/DA/" + $rootScope.zoomInOut + "/body-views/" + $rootScope.voId + "/layers/0/" + bodyRegionId + "/" + $scope.skinTone + "/" + $scope.bagartDetailsOnSktn[z]._ImageId; } } } else { - return "content/images/DA/" + $scope.zoomInOut + "/body-views/" + $rootScope.voId + "/layers/0/" + bodyRegionId + "/" + $scope.skinTone + "/" + $scope.bagartDetailsOnSktn[0]._ImageId; + return "content/images/DA/" + $rootScope.zoomInOut + "/body-views/" + $rootScope.voId + "/layers/0/" + bodyRegionId + "/" + $scope.skinTone + "/" + $scope.bagartDetailsOnSktn[0]._ImageId; } } @@ -5982,23 +5985,23 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo $scope.flushCanvas(); - if ($scope.zoomInOut == 25) { - $scope.zoomInOut = 75; + if ($rootScope.zoomInOut == 25) { + $rootScope.zoomInOut = 75; } else { - $scope.zoomInOut = 25; + $rootScope.zoomInOut = 25; } - + localStorage.setItem("zoomInOutValue", $rootScope.zoomInOut); //2. $scope.CalculateImageCordinates($rootScope.viewOrientationId); //3. - if ($scope.zoomInOut == 25) { + if ($rootScope.zoomInOut == 25) { if ($('#canvasDiv') != null) $('#canvasDiv').scrollLeft(0) @@ -8172,8 +8175,8 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo console.log('aligneCanvasWithTerm') // debugger - var newX = parseInt($scope.scaleValue($scope.termCoordinate.x, $scope.zoomInOut, DA[0].ZOOM_TERM_DATA)); - var newY = parseInt($scope.scaleValue($scope.termCoordinate.y, $scope.zoomInOut, DA[0].ZOOM_TERM_DATA)); + var newX = parseInt($scope.scaleValue($scope.termCoordinate.x, $rootScope.zoomInOut, DA[0].ZOOM_TERM_DATA)); + var newY = parseInt($scope.scaleValue($scope.termCoordinate.y, $rootScope.zoomInOut, DA[0].ZOOM_TERM_DATA)); var canvasX = parseInt(document.getElementById('canvasDiv').offsetLeft); var canvasY = parseInt(document.getElementById('canvasDiv').offsetTop);