Commit 74a3ef980036ced8be9227e8cf0466f16e49e29e

Authored by Amrita Vishnoi
1 parent 1a539f67

Bug#22872_1 is merged

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');
... ... @@ -7389,17 +7425,30 @@ AIA.controller(&quot;DAController&quot;, [&quot;$scope&quot;, &quot;$rootScope&quot;, &quot;$compile&quot;, &quot;$http&quot;, &quot;$l
7389 7425 }
7390 7426  
7391 7427 $scope.getTermNumberList = function (actualTermNo) {
7392   - $scope.termList = new jinqJs()
7393   - .from($rootScope.TermNumberData.TermData.Term)
7394   - .where('_ActualTermNumber == ' + actualTermNo)
7395   - .select();
7396   - if ($scope.termList != null || $scope.termList != undefined) {
7397   - return $scope.termList;
  7428 +
  7429 + if ($rootScope.TermNumberData != null) {
  7430 +
  7431 + $scope.termList = new jinqJs()
  7432 + .from($rootScope.TermNumberData.TermData.Term)
  7433 + .where('_ActualTermNumber == ' + actualTermNo)
  7434 + .select();
  7435 + if ($scope.termList != null || $scope.termList != undefined) {
  7436 + return $scope.termList;
  7437 + }
  7438 + else {
  7439 + return null;
  7440 + }
7398 7441 }
7399 7442 else {
7400   - return null;
  7443 + var currentBodyViewId = $rootScope.voId;
  7444 + var termJsonPath = '~/../content/data/json/da/body-views/' + currentBodyViewId + '/da_dat_tm_sg_' + currentBodyViewId + '.json';
  7445 + DataService.getAnotherJson(termJsonPath)
  7446 + .then(
  7447 + function (result) {
  7448 + $rootScope.TermNumberData = result;
  7449 + $scope.getTermNumberList(actualTermNo);
  7450 + })
7401 7451 }
7402   -
7403 7452 }
7404 7453  
7405 7454  
... ... @@ -8288,7 +8337,7 @@ AIA.controller(&quot;DAController&quot;, [&quot;$scope&quot;, &quot;$rootScope&quot;, &quot;$compile&quot;, &quot;$http&quot;, &quot;$l
8288 8337 }
8289 8338 }
8290 8339  
8291   - $rootScope.isSearchInputClicked = true;
  8340 +
8292 8341 $scope.ShowSearch = function () {
8293 8342 console.log('ShowSearch is called');
8294 8343 //this check is for log only because we are writing length so need to check if its not null or undefined
... ... @@ -8668,12 +8717,28 @@ AIA.controller(&quot;DAController&quot;, [&quot;$scope&quot;, &quot;$rootScope&quot;, &quot;$compile&quot;, &quot;$http&quot;, &quot;$l
8668 8717  
8669 8718 $scope.getChildTermList(termNo);
8670 8719 // $timeout(function () { $scope.getSiblings(termNo) }, 50);
8671   - $scope.getSiblings(termNo)
  8720 + $scope.getSiblings(termNo);
8672 8721 }
8673 8722  
8674 8723 }
8675 8724 }
8676 8725 }
  8726 + else {
  8727 + var currentBodyViewId = $rootScope.voId;
  8728 + var termJsonPath = '~/../content/data/json/da/body-views/' + currentBodyViewId + '/da_dat_tm_sg_' + currentBodyViewId + '.json';
  8729 + DataService.getAnotherJson(termJsonPath)
  8730 + .then(
  8731 + function (result) {
  8732 + $rootScope.TermNumberData = result;
  8733 + $scope.TermList = $scope.getTermNumberList($rootScope.actualTermNumber);
  8734 +
  8735 + if (($scope.TermList != null || $scope.TermList != undefined) && $scope.TermList.length > 0) {
  8736 +
  8737 + $scope.setLayerNumberAndHighlightByTermList();
  8738 + }
  8739 + })
  8740 + }
  8741 +
8677 8742 $('#txtlayerNumber').val((parseInt($scope.layerNumber)));
8678 8743 $('#layerChangeSlider').slider("option", "value", parseInt($rootScope.totalLayers) - parseInt($scope.layerNumber));
8679 8744  
... ...