Commit 65d2f64f56b69284a07bb9bc263c9be494d2c82a
1 parent
b5a93dbb
called loadSearchDataForBodyView from different location and also checking data …
…existance before showing this.If not exist exist tahn calling again loadSearchDataForBodyView.
Showing
1 changed file
with
17 additions
and
4 deletions
400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js
... | ... | @@ -422,6 +422,9 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo |
422 | 422 | //0.1 |
423 | 423 | var currentBodyViewId = localStorage.getItem("currentBodyViewId"); |
424 | 424 | |
425 | + $scope.loadSearchDataForBodyView(); | |
426 | + | |
427 | + | |
425 | 428 | console.log('currentBodyViewId pickjed from localStorage: ' + currentBodyViewId); |
426 | 429 | |
427 | 430 | var openViews; |
... | ... | @@ -499,7 +502,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo |
499 | 502 | //1. load navigator man first |
500 | 503 | $scope.LoadBodyViewNavigatorImage(); |
501 | 504 | |
502 | - $scope.loadSearchDataForBodyView(); | |
505 | + //$scope.loadSearchDataForBodyView(); | |
503 | 506 | |
504 | 507 | $scope.currentTitleFromJson = localStorage.getItem("currentViewTitle"); |
505 | 508 | |
... | ... | @@ -7348,11 +7351,21 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo |
7348 | 7351 | $scope.ShowSearch = function () { |
7349 | 7352 | |
7350 | 7353 | console.log('ShowSearch is called'); |
7354 | + //this check is for log only because we are writing length so need to check if its not null or undefined | |
7355 | + if ($scope.VocabTermTxt != null || $scope.VocabTermTxt != undefined) | |
7356 | + console.log('$scope.VocabTermTxt.length= ' + $scope.VocabTermTxt.length) | |
7351 | 7357 | |
7352 | 7358 | $timeout(function () { |
7353 | - $scope.IsSearchVisible = true; | |
7354 | - | |
7355 | - document.getElementById("termlistfilter").style.display = "block"; | |
7359 | + if (($scope.VocabTermTxt!=null|| $scope.VocabTermTxt!=undefined) && ($scope.VocabTermTxt.length > 0)) { | |
7360 | + $scope.IsSearchVisible = true; | |
7361 | + document.getElementById("termlistfilter").style.display = "block"; | |
7362 | + } | |
7363 | + else { | |
7364 | + $scope.loadSearchDataForBodyView(); | |
7365 | + if ($scope.VocabTermTxt.length > 0) { | |
7366 | + $scope.ShowSearch(); | |
7367 | + } | |
7368 | + } | |
7356 | 7369 | }, 500); |
7357 | 7370 | |
7358 | 7371 | //$scope.IsSearchVisible = true; | ... | ... |