From 5fadb9fc7bb9c917eea7e1c6115ed4e8e19cbe1d Mon Sep 17 00:00:00 2001 From: nikita Date: Thu, 14 Sep 2017 13:02:07 +0530 Subject: [PATCH] fixed bugs 22872, 22874, 22896, 7130 --- 400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js | 85 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++---------- 1 file changed, 75 insertions(+), 10 deletions(-) diff --git a/400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js b/400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js index 1360ad8..e49e343 100644 --- a/400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js +++ b/400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js @@ -767,6 +767,31 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l ' ').appendTo('#searchListDiv') $compile($e2)($scope); + $rootScope.isSearchInputClicked = true; + + console.log("INSIDE WATCH. LIST IS CREATED"); + $scope.isSearchDataLoaded = true; + + if (($scope.ColoredImageSRC != null || $scope.ColoredImageSRC != undefined)) { + + if ((($rootScope.viewOrientationId == '1') || ($rootScope.viewOrientationId == '4')) && ($scope.ColoredImageSRC.length == 9)) { + $rootScope.isLoading = false; + $('#spinner').css('visibility', 'hidden'); + } + else if ((($rootScope.viewOrientationId == '2') || ($rootScope.viewOrientationId == '3')) && ($scope.ColoredImageSRC.length == 5)) { + $rootScope.isLoading = false; + $('#spinner').css('visibility', 'hidden'); + } + else if (($rootScope.viewOrientationId == '5') && ($scope.ColoredImageSRC.length == 4)) { + $rootScope.isLoading = false; + $('#spinner').css('visibility', 'hidden'); + } + else if (($rootScope.viewOrientationId == '6') && ($scope.ColoredImageSRC.length == 1)) { + $rootScope.isLoading = false; + $('#spinner').css('visibility', 'hidden'); + } + } + }, 500); }, true); @@ -1777,6 +1802,12 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l } if ($scope.isEligibleForHighlight == true) { + + if ($scope.isSearchDataLoaded) { + $rootScope.isLoading = false; + $('#spinner').css('visibility', 'hidden'); + } + if ($scope.isExtract == true) { $rootScope.isLoading = true; $('#spinner').css('visibility', 'visible'); @@ -2184,6 +2215,11 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l if ($scope.isEligibleForHighlight == true) { + if ($scope.isSearchDataLoaded) { + $rootScope.isLoading = false; + $('#spinner').css('visibility', 'hidden'); + } + if ($scope.isExtract == true) { $rootScope.isLoading = true; $('#spinner').css('visibility', 'visible'); @@ -7379,17 +7415,30 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l } $scope.getTermNumberList = function (actualTermNo) { - $scope.termList = new jinqJs() - .from($rootScope.TermNumberData.TermData.Term) - .where('_ActualTermNumber == ' + actualTermNo) - .select(); - if ($scope.termList != null || $scope.termList != undefined) { - return $scope.termList; + + if ($rootScope.TermNumberData != null) { + + $scope.termList = new jinqJs() + .from($rootScope.TermNumberData.TermData.Term) + .where('_ActualTermNumber == ' + actualTermNo) + .select(); + if ($scope.termList != null || $scope.termList != undefined) { + return $scope.termList; + } + else { + return null; + } } else { - return null; + var currentBodyViewId = $rootScope.voId; + var termJsonPath = '~/../content/data/json/da/body-views/' + currentBodyViewId + '/da_dat_tm_sg_' + currentBodyViewId + '.json'; + DataService.getAnotherJson(termJsonPath) + .then( + function (result) { + $rootScope.TermNumberData = result; + $scope.getTermNumberList(actualTermNo); + }) } - } @@ -8278,7 +8327,7 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l } } - $rootScope.isSearchInputClicked = true; + $scope.ShowSearch = function () { console.log('ShowSearch is called'); //this check is for log only because we are writing length so need to check if its not null or undefined @@ -8658,12 +8707,28 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l $scope.getChildTermList(termNo); // $timeout(function () { $scope.getSiblings(termNo) }, 50); - $scope.getSiblings(termNo) + $scope.getSiblings(termNo); } } } } + else { + var currentBodyViewId = $rootScope.voId; + var termJsonPath = '~/../content/data/json/da/body-views/' + currentBodyViewId + '/da_dat_tm_sg_' + currentBodyViewId + '.json'; + DataService.getAnotherJson(termJsonPath) + .then( + function (result) { + $rootScope.TermNumberData = result; + $scope.TermList = $scope.getTermNumberList($rootScope.actualTermNumber); + + if (($scope.TermList != null || $scope.TermList != undefined) && $scope.TermList.length > 0) { + + $scope.setLayerNumberAndHighlightByTermList(); + } + }) + } + $('#txtlayerNumber').val((parseInt($scope.layerNumber))); $('#layerChangeSlider').slider("option", "value", parseInt($rootScope.totalLayers) - parseInt($scope.layerNumber)); -- libgit2 0.21.4