Commit 5fadb9fc7bb9c917eea7e1c6115ed4e8e19cbe1d

Authored by Nikita Kulshreshtha
1 parent 0f5aa9a7

fixed bugs 22872, 22874, 22896, 7130

400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js
... ... @@ -767,6 +767,31 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l
767 767 ' </li></ul>').appendTo('#searchListDiv')
768 768 $compile($e2)($scope);
769 769  
  770 + $rootScope.isSearchInputClicked = true;
  771 +
  772 + console.log("INSIDE WATCH. LIST IS CREATED");
  773 + $scope.isSearchDataLoaded = true;
  774 +
  775 + if (($scope.ColoredImageSRC != null || $scope.ColoredImageSRC != undefined)) {
  776 +
  777 + if ((($rootScope.viewOrientationId == '1') || ($rootScope.viewOrientationId == '4')) && ($scope.ColoredImageSRC.length == 9)) {
  778 + $rootScope.isLoading = false;
  779 + $('#spinner').css('visibility', 'hidden');
  780 + }
  781 + else if ((($rootScope.viewOrientationId == '2') || ($rootScope.viewOrientationId == '3')) && ($scope.ColoredImageSRC.length == 5)) {
  782 + $rootScope.isLoading = false;
  783 + $('#spinner').css('visibility', 'hidden');
  784 + }
  785 + else if (($rootScope.viewOrientationId == '5') && ($scope.ColoredImageSRC.length == 4)) {
  786 + $rootScope.isLoading = false;
  787 + $('#spinner').css('visibility', 'hidden');
  788 + }
  789 + else if (($rootScope.viewOrientationId == '6') && ($scope.ColoredImageSRC.length == 1)) {
  790 + $rootScope.isLoading = false;
  791 + $('#spinner').css('visibility', 'hidden');
  792 + }
  793 + }
  794 +
770 795 }, 500);
771 796  
772 797 }, true);
... ... @@ -1777,6 +1802,12 @@ AIA.controller(&quot;DAController&quot;, [&quot;$scope&quot;, &quot;$rootScope&quot;, &quot;$compile&quot;, &quot;$http&quot;, &quot;$l
1777 1802 }
1778 1803  
1779 1804 if ($scope.isEligibleForHighlight == true) {
  1805 +
  1806 + if ($scope.isSearchDataLoaded) {
  1807 + $rootScope.isLoading = false;
  1808 + $('#spinner').css('visibility', 'hidden');
  1809 + }
  1810 +
1780 1811 if ($scope.isExtract == true) {
1781 1812 $rootScope.isLoading = true;
1782 1813 $('#spinner').css('visibility', 'visible');
... ... @@ -2184,6 +2215,11 @@ AIA.controller(&quot;DAController&quot;, [&quot;$scope&quot;, &quot;$rootScope&quot;, &quot;$compile&quot;, &quot;$http&quot;, &quot;$l
2184 2215  
2185 2216 if ($scope.isEligibleForHighlight == true) {
2186 2217  
  2218 + if ($scope.isSearchDataLoaded) {
  2219 + $rootScope.isLoading = false;
  2220 + $('#spinner').css('visibility', 'hidden');
  2221 + }
  2222 +
2187 2223 if ($scope.isExtract == true) {
2188 2224 $rootScope.isLoading = true;
2189 2225 $('#spinner').css('visibility', 'visible');
... ... @@ -7379,17 +7415,30 @@ AIA.controller(&quot;DAController&quot;, [&quot;$scope&quot;, &quot;$rootScope&quot;, &quot;$compile&quot;, &quot;$http&quot;, &quot;$l
7379 7415 }
7380 7416  
7381 7417 $scope.getTermNumberList = function (actualTermNo) {
7382   - $scope.termList = new jinqJs()
7383   - .from($rootScope.TermNumberData.TermData.Term)
7384   - .where('_ActualTermNumber == ' + actualTermNo)
7385   - .select();
7386   - if ($scope.termList != null || $scope.termList != undefined) {
7387   - return $scope.termList;
  7418 +
  7419 + if ($rootScope.TermNumberData != null) {
  7420 +
  7421 + $scope.termList = new jinqJs()
  7422 + .from($rootScope.TermNumberData.TermData.Term)
  7423 + .where('_ActualTermNumber == ' + actualTermNo)
  7424 + .select();
  7425 + if ($scope.termList != null || $scope.termList != undefined) {
  7426 + return $scope.termList;
  7427 + }
  7428 + else {
  7429 + return null;
  7430 + }
7388 7431 }
7389 7432 else {
7390   - return null;
  7433 + var currentBodyViewId = $rootScope.voId;
  7434 + var termJsonPath = '~/../content/data/json/da/body-views/' + currentBodyViewId + '/da_dat_tm_sg_' + currentBodyViewId + '.json';
  7435 + DataService.getAnotherJson(termJsonPath)
  7436 + .then(
  7437 + function (result) {
  7438 + $rootScope.TermNumberData = result;
  7439 + $scope.getTermNumberList(actualTermNo);
  7440 + })
7391 7441 }
7392   -
7393 7442 }
7394 7443  
7395 7444  
... ... @@ -8278,7 +8327,7 @@ AIA.controller(&quot;DAController&quot;, [&quot;$scope&quot;, &quot;$rootScope&quot;, &quot;$compile&quot;, &quot;$http&quot;, &quot;$l
8278 8327 }
8279 8328 }
8280 8329  
8281   - $rootScope.isSearchInputClicked = true;
  8330 +
8282 8331 $scope.ShowSearch = function () {
8283 8332 console.log('ShowSearch is called');
8284 8333 //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(&quot;DAController&quot;, [&quot;$scope&quot;, &quot;$rootScope&quot;, &quot;$compile&quot;, &quot;$http&quot;, &quot;$l
8658 8707  
8659 8708 $scope.getChildTermList(termNo);
8660 8709 // $timeout(function () { $scope.getSiblings(termNo) }, 50);
8661   - $scope.getSiblings(termNo)
  8710 + $scope.getSiblings(termNo);
8662 8711 }
8663 8712  
8664 8713 }
8665 8714 }
8666 8715 }
  8716 + else {
  8717 + var currentBodyViewId = $rootScope.voId;
  8718 + var termJsonPath = '~/../content/data/json/da/body-views/' + currentBodyViewId + '/da_dat_tm_sg_' + currentBodyViewId + '.json';
  8719 + DataService.getAnotherJson(termJsonPath)
  8720 + .then(
  8721 + function (result) {
  8722 + $rootScope.TermNumberData = result;
  8723 + $scope.TermList = $scope.getTermNumberList($rootScope.actualTermNumber);
  8724 +
  8725 + if (($scope.TermList != null || $scope.TermList != undefined) && $scope.TermList.length > 0) {
  8726 +
  8727 + $scope.setLayerNumberAndHighlightByTermList();
  8728 + }
  8729 + })
  8730 + }
  8731 +
8667 8732 $('#txtlayerNumber').val((parseInt($scope.layerNumber)));
8668 8733 $('#layerChangeSlider').slider("option", "value", parseInt($rootScope.totalLayers) - parseInt($scope.layerNumber));
8669 8734  
... ...