Commit 9a36b11bae9e0f71b1aaebfbdf3986376bc76935
1 parent
f67b5c5f
storing zoomInOut vaue in localStrorage and made it rootscope varibale.
Showing
1 changed file
with
20 additions
and
17 deletions
400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js
... | ... | @@ -54,7 +54,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo |
54 | 54 | |
55 | 55 | // $scope.AnteriorView = "active"; |
56 | 56 | |
57 | - $scope.zoomInOut = 75; | |
57 | + $rootScope.zoomInOut = 75; | |
58 | 58 | $scope.speechBubbleCounter = 0; |
59 | 59 | $scope.j = 0; |
60 | 60 | $scope.speechbubbleList = []; |
... | ... | @@ -251,7 +251,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo |
251 | 251 | |
252 | 252 | } |
253 | 253 | |
254 | - $scope.imagePath = "~/../content/images/DA/" + $scope.zoomInOut + "/body-views/" + value._id + '/skintone/' + userEthnicity + '/' + thumbnailImage; | |
254 | + $scope.imagePath = "~/../content/images/DA/" + $rootScope.zoomInOut + "/body-views/" + value._id + '/skintone/' + userEthnicity + '/' + thumbnailImage; | |
255 | 255 | |
256 | 256 | |
257 | 257 | var $el = $('<div id=' + value._id + ' class="col-sm-3 col-lg-2" title = ' + value._title + ' data-ng-click="openView($event)"><div class="thumbnail" >' |
... | ... | @@ -962,6 +962,9 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo |
962 | 962 | |
963 | 963 | } |
964 | 964 | |
965 | + if (localStorage.getItem("zoomInOutValue")!=undefined) | |
966 | + $rootScope.zoomInOut = localStorage.getItem("zoomInOutValue"); | |
967 | + | |
965 | 968 | if ($scope.bodyRegionCoordinates != null || $scope.bodyRegionCoordinates != undefined) { |
966 | 969 | angular.forEach($scope.bodyRegionCoordinates, function (value, key) { |
967 | 970 | |
... | ... | @@ -1096,7 +1099,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo |
1096 | 1099 | var rectangle = scaleRectangle(value._X, value._Y, value._Height, value._Width, value._MirrorValue); |
1097 | 1100 | |
1098 | 1101 | |
1099 | - var src = "content/images/DA/" + $scope.zoomInOut + "/body-views/" + $rootScope.voId + "/layers/0/" + value._BodyRegionId + "/" + $scope.figLaefImageName; | |
1102 | + var src = "content/images/DA/" + $rootScope.zoomInOut + "/body-views/" + $rootScope.voId + "/layers/0/" + value._BodyRegionId + "/" + $scope.figLaefImageName; | |
1100 | 1103 | |
1101 | 1104 | $scope.DrawImage(rectangle.scaledHeight, rectangle.scaledWidth, rectangle.scaledX, rectangle.scaledY, src, 'modestyImg' + value._BodyRegionId, 'N') |
1102 | 1105 | |
... | ... | @@ -1193,7 +1196,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo |
1193 | 1196 | } |
1194 | 1197 | |
1195 | 1198 | function scaleRectangle(x, y, height, width, mirrorValue) { |
1196 | - var nzoom = $scope.zoomInOut; | |
1199 | + var nzoom = $rootScope.zoomInOut; | |
1197 | 1200 | var existingZoon = 100; |
1198 | 1201 | |
1199 | 1202 | var X = 0; |
... | ... | @@ -1282,7 +1285,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo |
1282 | 1285 | if ($rootScope.viewOrientationId == 3 && bodyRegionId == 1) { |
1283 | 1286 | console.log('$rootScope.voId: ' + $rootScope.voId); |
1284 | 1287 | if (bodyRegion == bodyRegionId && bodyRegionSkinTone == 'W') { |
1285 | - return "content/images/DA/" + $scope.zoomInOut + "/body-views/" + $rootScope.voId + "/layers/" + $scope.layerNumber + "/" + bodyRegionId + "/W/" + SelectedLayerData.BodyRegion[z].Image._ImageName; | |
1288 | + return "content/images/DA/" + $rootScope.zoomInOut + "/body-views/" + $rootScope.voId + "/layers/" + $scope.layerNumber + "/" + bodyRegionId + "/W/" + SelectedLayerData.BodyRegion[z].Image._ImageName; | |
1286 | 1289 | } |
1287 | 1290 | } |
1288 | 1291 | |
... | ... | @@ -1290,7 +1293,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo |
1290 | 1293 | |
1291 | 1294 | if (bodyRegion == bodyRegionId && bodyRegionSkinTone == $scope.skinTone) { |
1292 | 1295 | |
1293 | - return "content/images/DA/" + $scope.zoomInOut + "/body-views/" + $rootScope.voId + "/layers/" + $scope.layerNumber + "/" + bodyRegionId + "/" + $scope.skinTone + "/" + SelectedLayerData.BodyRegion[z].Image._ImageName; | |
1296 | + return "content/images/DA/" + $rootScope.zoomInOut + "/body-views/" + $rootScope.voId + "/layers/" + $scope.layerNumber + "/" + bodyRegionId + "/" + $scope.skinTone + "/" + SelectedLayerData.BodyRegion[z].Image._ImageName; | |
1294 | 1297 | } |
1295 | 1298 | } |
1296 | 1299 | } |
... | ... | @@ -1302,7 +1305,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo |
1302 | 1305 | if (($rootScope.voId == '9') || ($rootScope.voId == '11') || ($rootScope.voId == '10') || ($rootScope.voId == '12')) { |
1303 | 1306 | var bodyRegion = SelectedLayerData.BodyRegion._BodyRegionId; |
1304 | 1307 | |
1305 | - return "content/images/DA/" + $scope.zoomInOut + "/body-views/" + $rootScope.voId + "/layers/" + $scope.layerNumber + "/" + bodyRegionId + "/" + SelectedLayerData.BodyRegion.Image._ImageName; | |
1308 | + return "content/images/DA/" + $rootScope.zoomInOut + "/body-views/" + $rootScope.voId + "/layers/" + $scope.layerNumber + "/" + bodyRegionId + "/" + SelectedLayerData.BodyRegion.Image._ImageName; | |
1306 | 1309 | |
1307 | 1310 | } |
1308 | 1311 | else // it is for other body view which have multiple body regions and layer no > 0 |
... | ... | @@ -1313,7 +1316,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo |
1313 | 1316 | var bodyRegion = SelectedLayerData.BodyRegion[z]._BodyRegionId; |
1314 | 1317 | if (bodyRegion == bodyRegionId) { |
1315 | 1318 | |
1316 | - return "content/images/DA/" + $scope.zoomInOut + "/body-views/" + $rootScope.voId + "/layers/" + $scope.layerNumber + "/" + bodyRegionId + "/" + SelectedLayerData.BodyRegion[z].Image._ImageName; | |
1319 | + return "content/images/DA/" + $rootScope.zoomInOut + "/body-views/" + $rootScope.voId + "/layers/" + $scope.layerNumber + "/" + bodyRegionId + "/" + SelectedLayerData.BodyRegion[z].Image._ImageName; | |
1317 | 1320 | |
1318 | 1321 | |
1319 | 1322 | } |
... | ... | @@ -1355,13 +1358,13 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo |
1355 | 1358 | for (var z = 0; z <= $scope.bagartDetailsOnSktn.length; z++) { |
1356 | 1359 | var gender = $scope.bagartDetailsOnSktn[z]._Gender; |
1357 | 1360 | if (gender == selectedGender) { |
1358 | - return "content/images/DA/" + $scope.zoomInOut + "/body-views/" + $rootScope.voId + "/layers/0/" + bodyRegionId + "/" + $scope.skinTone + "/" + $scope.bagartDetailsOnSktn[z]._ImageId; | |
1361 | + return "content/images/DA/" + $rootScope.zoomInOut + "/body-views/" + $rootScope.voId + "/layers/0/" + bodyRegionId + "/" + $scope.skinTone + "/" + $scope.bagartDetailsOnSktn[z]._ImageId; | |
1359 | 1362 | } |
1360 | 1363 | } |
1361 | 1364 | } |
1362 | 1365 | |
1363 | 1366 | else { |
1364 | - return "content/images/DA/" + $scope.zoomInOut + "/body-views/" + $rootScope.voId + "/layers/0/" + bodyRegionId + "/" + $scope.skinTone + "/" + $scope.bagartDetailsOnSktn[0]._ImageId; | |
1367 | + return "content/images/DA/" + $rootScope.zoomInOut + "/body-views/" + $rootScope.voId + "/layers/0/" + bodyRegionId + "/" + $scope.skinTone + "/" + $scope.bagartDetailsOnSktn[0]._ImageId; | |
1365 | 1368 | |
1366 | 1369 | } |
1367 | 1370 | } |
... | ... | @@ -5976,23 +5979,23 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo |
5976 | 5979 | |
5977 | 5980 | $scope.flushCanvas(); |
5978 | 5981 | |
5979 | - if ($scope.zoomInOut == 25) { | |
5980 | - $scope.zoomInOut = 75; | |
5982 | + if ($rootScope.zoomInOut == 25) { | |
5983 | + $rootScope.zoomInOut = 75; | |
5981 | 5984 | |
5982 | 5985 | } |
5983 | 5986 | else { |
5984 | - $scope.zoomInOut = 25; | |
5987 | + $rootScope.zoomInOut = 25; | |
5985 | 5988 | |
5986 | 5989 | |
5987 | 5990 | } |
5988 | - | |
5991 | + localStorage.setItem("zoomInOutValue", $rootScope.zoomInOut); | |
5989 | 5992 | //2. |
5990 | 5993 | $scope.CalculateImageCordinates($rootScope.viewOrientationId); |
5991 | 5994 | |
5992 | 5995 | //3. |
5993 | 5996 | |
5994 | 5997 | |
5995 | - if ($scope.zoomInOut == 25) { | |
5998 | + if ($rootScope.zoomInOut == 25) { | |
5996 | 5999 | if ($('#canvasDiv') != null) |
5997 | 6000 | $('#canvasDiv').scrollLeft(0) |
5998 | 6001 | |
... | ... | @@ -8166,8 +8169,8 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo |
8166 | 8169 | console.log('aligneCanvasWithTerm') |
8167 | 8170 | // debugger |
8168 | 8171 | |
8169 | - var newX = parseInt($scope.scaleValue($scope.termCoordinate.x, $scope.zoomInOut, DA[0].ZOOM_TERM_DATA)); | |
8170 | - var newY = parseInt($scope.scaleValue($scope.termCoordinate.y, $scope.zoomInOut, DA[0].ZOOM_TERM_DATA)); | |
8172 | + var newX = parseInt($scope.scaleValue($scope.termCoordinate.x, $rootScope.zoomInOut, DA[0].ZOOM_TERM_DATA)); | |
8173 | + var newY = parseInt($scope.scaleValue($scope.termCoordinate.y, $rootScope.zoomInOut, DA[0].ZOOM_TERM_DATA)); | |
8171 | 8174 | |
8172 | 8175 | var canvasX = parseInt(document.getElementById('canvasDiv').offsetLeft); |
8173 | 8176 | var canvasY = parseInt(document.getElementById('canvasDiv').offsetTop); | ... | ... |