Commit a9a7faa4e453b55119ebd05a22f8e9fc0538df91

Authored by Nikita Kulshreshtha
2 parents ee3c0e26 fd12dd5e

Merge branch 'DASearchBindingOldDev' of http://52.6.196.163/ADAM/AIAHTML5 into SearchIssue

400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js
... ... @@ -634,6 +634,22 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
634 634 }
635 635 }
636 636  
  637 + //call watch on '$scope.VocabTermTxt and compile <li> and append to <ul> on first time load
  638 + $scope.$watch('$scope.VocabTermTxt', function (newValue, oldValue, scope) {
  639 +
  640 + //This is added as the $scope.VocabTermTxt can change while changing view also the li elements need to be removed
  641 + //Remove the list and then Repopulate
  642 + $('#searchListDiv').empty()
  643 + //Delay compile of ul li so that the remove of li is completed.
  644 + $timeout(function () {
  645 + var $e2 = $('<ul id="termlistfilter" class="form-control dropdown-menu" style="height:90px;width:100%;overflow-y:scroll;position:absolute;display:none;z-index:1000;"><li ng-repeat="item in VocabTermTxt| filter:{ _TermText: searchFilter}">' +
  646 + '<a id="{{item._ActualTermNumber}}" href="" onclick="selectTerm(event)">{{item._TermText}}</a>' +
  647 + ' </li></ul>').appendTo('#searchListDiv')
  648 + $compile($e2)($scope);
  649 + }, 500);
  650 +
  651 + }, true);
  652 +
637 653 }
638 654  
639 655 $scope.loadBodyViewData = function (currentVoid) {
... ... @@ -6562,7 +6578,8 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
6562 6578  
6563 6579 // $rootScope.isHighlightBodyByBodySystem = false;
6564 6580  
6565   -
  6581 + //Remove the Search list and then Repopulate it on change of Gender
  6582 + $('#searchListDiv').empty()
6566 6583  
6567 6584 $rootScope.isGenderChnage = true;
6568 6585  
... ... @@ -6791,7 +6808,8 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
6791 6808  
6792 6809 // $rootScope.isHighlightBodyByBodySystem = false;
6793 6810  
6794   -
  6811 + //Remove the search list and then Repopulate it on change of View
  6812 + $('#searchListDiv').empty()
6795 6813  
6796 6814 if ($rootScope.openViews.length > 0) {
6797 6815 $rootScope.openViews.splice($rootScope.openViews.length - 1);
... ... @@ -8171,6 +8189,21 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
8171 8189 }
8172 8190 }
8173 8191  
  8192 + $scope.resetSearchListView = function () {
  8193 +
  8194 + //Remove the list and then Repopulate it on change of $scope.searchFilter
  8195 + $('#searchListDiv').empty()
  8196 + // added the timeout to delay the compile of ul li
  8197 + $timeout(function () {
  8198 + var $e2 = $('<ul id="termlistfilter" class="form-control dropdown-menu" style="height:90px;width:100%;overflow-y:scroll;position:absolute;display:none;z-index:1000;"><li ng-repeat="item in VocabTermTxt| filter:{ _TermText: searchFilter}">' +
  8199 + '<a id="{{item._ActualTermNumber}}" href="" onclick="selectTerm(event)">{{item._TermText}}</a>' +
  8200 + ' </li></ul>').appendTo('#searchListDiv')
  8201 + $compile($e2)($scope);
  8202 + }, 500);
  8203 +
  8204 +
  8205 + }
  8206 +
8174 8207  
8175 8208 }]
8176 8209  
... ...
400-SOURCECODE/AIAHTML5.Web/app/views/da/da-view.html
... ... @@ -280,17 +280,16 @@
280 280 <div class="">
281 281 <div class="input-group col-sm-8 col-xs-7 col-md-10 pull-left">
282 282  
283   - <input type="text" class="form-control input-sm pull-left" id="typedtermname" ng-blur="HideSearch()" onclick="OnSearch()" ondblclick="OnSearch()" ng-model="searchFilter" ng-change="textChange(searchFilter)" placeholder="Search...">
  283 + <input type="text" class="form-control input-sm pull-left" id="typedtermname" ng-blur="HideSearch()" onclick="OnSearch()" ondblclick="OnSearch()" ng-model="searchFilter" ng-change="resetSearchListView()" " placeholder=" search...">
284 284  
285 285 <div id="backdrop" ng-show="IsSearchVisible">
286   - <div class="col-sm-12 col-xs-12 col-md-12 col-lg-12 pull-left">
  286 + <div id="searchListDiv" class="col-sm-12 col-xs-12 col-md-12 col-lg-12 pull-left">
287 287 <!--#Bug 6591-->
288   - <ul id="termlistfilter" class="form-control dropdown-menu" style="height:90px;width:100%;overflow-y:scroll;position:absolute;display:none;z-index:1000;">
  288 + <!--<ul id="termlistfilter" class="form-control dropdown-menu" style="height:90px;width:100%;overflow-y:scroll;position:absolute;display:none;z-index:1000;">
289 289 <li ng-repeat="item in VocabTermTxt| filter:{ _TermText: searchFilter}">
290   - <!--<a id="{{item._ActualTermNumber}}" href="" ng-click="jumpToTerm($event)">{{item._TermText}}</a>-->
291 290 <a id="{{item._ActualTermNumber}}" href="" onclick="selectTerm(event)">{{item._TermText}}</a>
292 291 </li>
293   - </ul>
  292 + </ul>-->
294 293 </div>
295 294 </div>
296 295 <!--</div>-->
... ...