From f1ec92556e2e17e2cc818a47248043dbefef13a2 Mon Sep 17 00:00:00 2001 From: nikita Date: Mon, 29 Aug 2016 14:06:35 +0530 Subject: [PATCH] skintone setting issue is fixed. made layer number as rootscope variable. --- 400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js | 50 +++++++++++++++++++++++++------------------------- 1 file changed, 25 insertions(+), 25 deletions(-) diff --git a/400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js b/400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js index 011cea5..1229e7c 100644 --- a/400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js +++ b/400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js @@ -24,7 +24,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo $scope.drawnBodyRegions; //view specific constants $rootScope.voId; - $scope.layerNumber; + $rootScope.layerNumber; $scope.daCounter = 1; $scope.bagartDetails; $scope.transNumber = 50; @@ -624,7 +624,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo $rootScope.isNormalMode = true; - $scope.layerNumber = 0; + $rootScope.layerNumber = 0; $scope.skinTone = $rootScope.globalSetting.ethnicity; $rootScope.viewOrientationId = $rootScope.voId; @@ -840,7 +840,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo if ((dtlOfSktn != null || dtlOfSktn != undefined) && (dtlOfSktn.length > 0)) { - if ((parseInt(dtlOfSktn[0]._lns) <= parseInt($scope.layerNumber)) && (parseInt(dtlOfSktn[0]._lne) > parseInt($scope.layerNumber)) && (dtlOfSktn[0]._isfr == 'Y')) { + if ((parseInt(dtlOfSktn[0]._lns) <= parseInt($rootScope.layerNumber)) && (parseInt(dtlOfSktn[0]._lne) > parseInt($rootScope.layerNumber)) && (dtlOfSktn[0]._isfr == 'Y')) { $scope.figLaefImageName = dtlOfSktn[0]._ImageId; //$scope.figLaefX = filtereddata[0]._X; //$scope.figLaefY = filtereddata[0]._Y; @@ -895,7 +895,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo $('#canvasDiv').scrollTop(50) var abc = $rootScope.BodyRegionCordinatesData; //debugger; - $('#layerChangeSlider').slider("option", "value", parseInt($scope.totalLayers) - parseInt($scope.layerNumber)); + $('#layerChangeSlider').slider("option", "value", parseInt($scope.totalLayers) - parseInt($rootScope.layerNumber)); // $('#spinner').css('visibility', 'hidden'); $rootScope.isLoading = false; //Dated:16-07-2016 Issue #4957 :While selecting the Zoom-in\Zoom-out button scroll should be go on top. @@ -1001,19 +1001,19 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo // debugger $('#txtLayerNumber').attr('max', $scope.totalLayers); $('#layerChangeSlider').slider("option", "max", $scope.totalLayers); - // $('#layerChangeSlider').slider("option", "value",parseInt($scope.totalLayers)-parseInt($scope.layerNumber)); + // $('#layerChangeSlider').slider("option", "value",parseInt($scope.totalLayers)-parseInt($rootScope.layerNumber)); $scope.one = 1; - $scope.userInput = parseInt($scope.layerNumber); + $scope.userInput = parseInt($rootScope.layerNumber); $scope.skinTone = $rootScope.globalSetting.ethnicity; var SelectedLayerData = []; SelectedLayerData = $rootScope.BodyLayerData.Layers.DataLayer[dataLength - $scope.userInput - 1]; if ((SelectedLayerData != null || SelectedLayerData != undefined)) - if ($scope.layerNumber == 0) { - console.log('lNo: ' + $scope.layerNumber + ' and BodyRegion.length: ' + SelectedLayerData.BodyRegion.length); + if ($rootScope.layerNumber == 0) { + console.log('lNo: ' + $rootScope.layerNumber + ' and BodyRegion.length: ' + SelectedLayerData.BodyRegion.length); if (SelectedLayerData.BodyRegion.length > 0) { for (var z = 0; z < SelectedLayerData.BodyRegion.length; z++) { @@ -1024,7 +1024,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/" + $scope.zoomInOut + "/body-views/" + $rootScope.voId + "/layers/" + $rootScope.layerNumber + "/" + bodyRegionId + "/W/" + SelectedLayerData.BodyRegion[z].Image._ImageName; } } @@ -1032,7 +1032,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/" + $scope.zoomInOut + "/body-views/" + $rootScope.voId + "/layers/" + $rootScope.layerNumber + "/" + bodyRegionId + "/" + $scope.skinTone + "/" + SelectedLayerData.BodyRegion[z].Image._ImageName; } } } @@ -1044,7 +1044,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/" + $scope.zoomInOut + "/body-views/" + $rootScope.voId + "/layers/" + $rootScope.layerNumber + "/" + bodyRegionId + "/" + SelectedLayerData.BodyRegion.Image._ImageName; } else // it is for other body view which have multiple body regions and layer no > 0 @@ -1055,7 +1055,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/" + $scope.zoomInOut + "/body-views/" + $rootScope.voId + "/layers/" + $rootScope.layerNumber + "/" + bodyRegionId + "/" + SelectedLayerData.BodyRegion[z].Image._ImageName; } @@ -2402,7 +2402,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo if (TransparencyBoxStartX <= bodyRegionRight && value.X <= transparencyBoxRight && TransparencyBoxStartY <= bodyRegionBottom && value.Y <= transparencyBoxBottom) { //var transNumber = parseInt(document.getElementById("txtTransparencyChange").value); // debugger; - $scope.layerNumber = parseInt(txtlayerNumber.value); + $rootScope.layerNumber = parseInt(txtlayerNumber.value); $scope.loadTransparencyImage(value.bodyRegionId, value.Height, value.Width, value.X, value.Y, value.IsMirror, TransparencyBoxStartX, transparencyBoxRight, TransparencyBoxStartY, transparencyBoxBottom, $scope, true, false); @@ -2418,7 +2418,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo if (parseInt($('#txtlayerNumber').val()) > (dataLength - 1)) { $('#txtlayerNumber').val(dataLength - 1); $scope.currentLayerNumber = parseInt(dataLength - 1); - $scope.layerNumber = parseInt(dataLength - 1); + $rootScope.layerNumber = parseInt(dataLength - 1); } else $scope.currentLayerNumber = parseInt($('#txtlayerNumber').val()); @@ -2441,7 +2441,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo $timeout(function () { $scope.DisableProgressBar() }, 1000); } - $('#layerChangeSlider').slider("option", "value", parseInt($scope.totalLayers) - parseInt($scope.layerNumber)); + $('#layerChangeSlider').slider("option", "value", parseInt($scope.totalLayers) - parseInt($rootScope.layerNumber)); } $scope.DisableProgressBar = function () { @@ -3669,14 +3669,14 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo } else if (isLayerChanged) { // debugger - $scope.layerNumber = parseInt($('#txtlayerNumber').val()); + $rootScope.layerNumber = parseInt($('#txtlayerNumber').val()); } else { var currentLayer = parseInt($('#txtlayerNumber').val()); var tranparencyLayer = currentLayer + 1; - $scope.layerNumber = tranparencyLayer; + $rootScope.layerNumber = tranparencyLayer; } //dedebugger; @@ -3908,7 +3908,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo PreviousBodyRegionX = XforTransImage; previousBodyRegionId = bodyRegionId; - // $scope.layerNumber = parseInt($scope.layerNumber - 1); + // $rootScope.layerNumber = parseInt($rootScope.layerNumber - 1); } @@ -4407,7 +4407,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo } //var scope = angular.element(document.getElementById("DAView")).scope(); //scope.$apply(function () { - // $scope.layerNumber = 0; + // $rootScope.layerNumber = 0; $scope.isTransparencyActivated = false; //}) @@ -4421,7 +4421,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo //$("canvas[name*='transparencyTempCanvas']").nextUntil($("canvas[name*='transparencyTempCanvas']")) //.remove(); - $scope.layerNumber = $scope.currentLayerNumber; + $rootScope.layerNumber = $scope.currentLayerNumber; $scope.transNumber = 50; $(".slider").slider({ value: 50 }) } @@ -5356,7 +5356,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo $('#spinner').css('visibility', 'visible'); $rootScope.isViewChange = true; - $scope.layerNumber = 0; + $rootScope.layerNumber = 0; // debugger; var selectedViewId = $scope.bodyViews[event.currentTarget.attributes[1].value]; $rootScope.viewOrientationId = selectedViewId; @@ -5496,7 +5496,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo //console.log('reloadDABodyViewEvent'); $scope.ReloadBodyViewId = data.reloadDABodyViewId; - // $scope.layerNumber = 0; + // $rootScope.layerNumber = 0; // debugger; console.log('reloadDABodyViewEvent ' + $scope.ReloadBodyViewId); @@ -6864,7 +6864,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo layerNumber = parseInt(layerNumber) - 1; } - $scope.layerNumber = layerNumber; + $rootScope.layerNumber = layerNumber; //4.get scroll position if (actualTermNumber != DA[0].SKIN_TERM_ID) { @@ -6905,8 +6905,8 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo } } - $('#txtlayerNumber').val((parseInt($scope.layerNumber))); - $('#layerChangeSlider').slider("option", "value", parseInt($scope.totalLayers) - parseInt($scope.layerNumber)); + $('#txtlayerNumber').val((parseInt($rootScope.layerNumber))); + $('#layerChangeSlider').slider("option", "value", parseInt($scope.totalLayers) - parseInt($rootScope.layerNumber)); //8.remove current layer canavses $scope.flushCanvas(); -- libgit2 0.21.4