Commit 6b8fe4759e0c75d9e85012b703e4a499b2522b60

Authored by Nikita Kulshreshtha
1 parent 83721824

hiding wait cursor.

added length check.
400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js
... ... @@ -2648,26 +2648,32 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
2648 2648  
2649 2649  
2650 2650 var multiTermList = [];
2651   - angular.forEach($rootScope.previousHighlightList, function (value, key) {
2652   - var ActualTermNo = $scope.getActualTermNumber(value);
2653   - if (ActualTermNo != null) {
2654   - var TermList = $scope.getTermNumberList(ActualTermNo);
2655   - if (TermList != null) {
2656   - for (var i = 0; i < TermList.length; i++) {
2657   -
2658   - multiTermList.push(TermList[i]);
  2651 +
  2652 + angular.forEach($rootScope.previousHighlightList, function (value, key) {
  2653 + var ActualTermNo = $scope.getActualTermNumber(value);
  2654 + if (ActualTermNo != null && ActualTermNo != undefined) {
  2655 + var TermList = $scope.getTermNumberList(ActualTermNo);
  2656 + if (TermList != null) {
  2657 + for (var i = 0; i < TermList.length; i++) {
  2658 +
  2659 + multiTermList.push(TermList[i]);
  2660 + }
2659 2661 }
2660 2662 }
2661   - }
2662   -
2663   - });
2664 2663  
  2664 + });
  2665 +
2665 2666 console.log('createTermListByPreviousTermsAndHighlight is called');
2666 2667  
2667   - if ((multiTermList != undefined || multiTermList != null) && multiTermList.length > 0) {
  2668 + if ((multiTermList != undefined && multiTermList != null) && multiTermList.length > 0) {
2668 2669  
2669 2670 $timeout(function () { $scope.HighlightBodyByTermList(multiTermList); }, 50);
2670 2671 }
  2672 + else {
  2673 + $rootScope.isLoading = false;
  2674 +
  2675 + $('#spinner').css('visibility', 'hidden');
  2676 + }
2671 2677 }
2672 2678  
2673 2679  
... ... @@ -6785,7 +6791,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
6785 6791 .from($rootScope.TermNumberData.TermData.Term)
6786 6792 .where('_TermNumber == ' + iColor)
6787 6793 .select('_ActualTermNumber');
6788   - if ($scope.actualTermNo != null || actualTermNo != undefined) {
  6794 + if ($scope.actualTermNo != null && $scope.actualTermNo != undefined && $scope.actualTermNo.length>0) {
6789 6795  
6790 6796 return $scope.actualTermNo[0]._ActualTermNumber;
6791 6797 }
... ... @@ -8436,7 +8442,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
8436 8442 }
8437 8443  
8438 8444 $scope.resetSearchListView = function () {
8439   -
  8445 +
8440 8446 $("#termlistfilter").css("display", "block");
8441 8447 //Remove the list and then Repopulate it on change of $scope.searchFilter
8442 8448 $('#searchListDiv').empty();
... ... @@ -8444,13 +8450,12 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
8444 8450 // added the timeout to delay the compile of ul li
8445 8451 $scope.IsSearchVisible = true;
8446 8452 var isValueMatchedWithTerm = false;
8447   - for (var i = 0; i <= $rootScope.searchListArray.length - 1; i++)
8448   - {
  8453 + for (var i = 0; i <= $rootScope.searchListArray.length - 1; i++) {
8449 8454 var searchFieldVal = $("#typedTermName").val();
8450 8455 if (searchFieldVal.length > 0) {
8451   -
  8456 +
8452 8457 for (var j = 0; j <= searchFieldVal.length - 1; j++) {
8453   -
  8458 +
8454 8459 if (searchFieldVal[j].toUpperCase() != $rootScope.searchListArray[i].name[j].toUpperCase()) {
8455 8460 isValueMatchedWithTerm = false;
8456 8461 break;
... ... @@ -8460,35 +8465,34 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
8460 8465 }
8461 8466 }
8462 8467 if (isValueMatchedWithTerm == true) {
8463   - $rootScope.ModifiedsearchListArray.push({ "name": $rootScope.searchListArray[i].name, "id": $rootScope.searchListArray[i].id});
  8468 + $rootScope.ModifiedsearchListArray.push({ "name": $rootScope.searchListArray[i].name, "id": $rootScope.searchListArray[i].id });
8464 8469 console.log($rootScope.ModifiedsearchListArray);
8465 8470 }
8466   -
  8471 +
8467 8472 }
8468 8473 }
8469   -
  8474 +
8470 8475 var termListFilterHtml = '';
8471 8476 termListFilterHtml += '<ul id="termlistfilter" class="form-control dropdown-menu" style="height:90px;width:100%;overflow-y:scroll;position:absolute;z-index:60001;">';
8472 8477 if ($("#typedTermName").val().length > 0) {
8473 8478  
8474 8479 for (var i = 0; i <= $rootScope.ModifiedsearchListArray.length - 1; i++) {
8475   -
  8480 +
8476 8481 termListFilterHtml += '<li><a id=' + $rootScope.ModifiedsearchListArray[i].id + ' href="javascript:void(0);" onclick="selectTerm(event)">' + $rootScope.ModifiedsearchListArray[i].name + '</a></li>';
8477 8482 }
8478 8483 termListFilterHtml += '</ul>';
8479 8484 $('#searchListDiv').append(termListFilterHtml);
8480   -
  8485 +
8481 8486 }
8482   - else
8483   - {
  8487 + else {
8484 8488 console.log($rootScope.searchListArray.length);
8485 8489 for (var i = 0; i <= $rootScope.searchListArray.length - 1; i++) {
8486   -
  8490 +
8487 8491 termListFilterHtml += '<li><a id=' + $rootScope.searchListArray[i].id + ' href="javascript:void(0);" onclick="selectTerm(event)">' + $rootScope.searchListArray[i].name + '</a></li>';
8488 8492 }
8489 8493 termListFilterHtml += '</ul>';
8490 8494 $('#searchListDiv').append(termListFilterHtml);
8491   -
  8495 +
8492 8496 }
8493 8497 }
8494 8498  
... ...