diff --git a/400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js b/400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js index 2071683..42ffa43 100644 --- a/400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js +++ b/400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js @@ -23,7 +23,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; @@ -623,7 +623,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; @@ -721,6 +721,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo { angular.forEach($scope.bodyRegionCoordinates, function (value, key) { + console.log('$scope.bodyRegionCoordinates length= ' + $scope.bodyRegionCoordinates.length) if (value._HaveMirrorImage == 'Y') { @@ -841,7 +842,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; @@ -896,7 +897,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. @@ -995,18 +996,18 @@ 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) { + if ($rootScope.layerNumber == 0) { if (SelectedLayerData.BodyRegion.length > 0) { for (var z = 0; z < SelectedLayerData.BodyRegion.length; z++) { @@ -1015,7 +1016,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; } } } @@ -1026,7 +1027,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 @@ -1037,7 +1038,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; } @@ -2376,7 +2377,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); @@ -2392,7 +2393,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()); @@ -2415,7 +2416,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 () { @@ -3641,14 +3642,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; @@ -3880,7 +3881,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); } @@ -4379,7 +4380,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; //}) @@ -4393,7 +4394,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 }) } @@ -5309,7 +5310,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; @@ -5449,9 +5450,9 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo //console.log('reloadDABodyViewEvent'); $scope.ReloadBodyViewId = data.reloadDABodyViewId; - // $scope.layerNumber = 0; + // $rootScope.layerNumber = 0; // debugger; - + var layerNumber = $rootScope.layerNumber console.log('reloadDABodyViewEvent ' + $scope.ReloadBodyViewId); if ($rootScope.isSettingEventAlredayDispachted == true) { @@ -6775,7 +6776,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) { @@ -6816,8 +6817,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();