Commit fd12dd5e41f72533384947b2e024b8795488ca4d

Authored by Mitali Srivastava
1 parent 2ca436a7

Bug #12897

400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js
@@ -621,6 +621,22 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo @@ -621,6 +621,22 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
621 } 621 }
622 } 622 }
623 623
  624 + //call watch on '$scope.VocabTermTxt and compile <li> and append to <ul> on first time load
  625 + $scope.$watch('$scope.VocabTermTxt', function (newValue, oldValue, scope) {
  626 +
  627 + //This is added as the $scope.VocabTermTxt can change while changing view also the li elements need to be removed
  628 + //Remove the list and then Repopulate
  629 + $('#searchListDiv').empty()
  630 + //Delay compile of ul li so that the remove of li is completed.
  631 + $timeout(function () {
  632 + 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}">' +
  633 + '<a id="{{item._ActualTermNumber}}" href="" onclick="selectTerm(event)">{{item._TermText}}</a>' +
  634 + ' </li></ul>').appendTo('#searchListDiv')
  635 + $compile($e2)($scope);
  636 + }, 500);
  637 +
  638 + }, true);
  639 +
624 } 640 }
625 641
626 $scope.loadBodyViewData = function (currentVoid) { 642 $scope.loadBodyViewData = function (currentVoid) {
@@ -6570,7 +6586,8 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo @@ -6570,7 +6586,8 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
6570 6586
6571 // $rootScope.isHighlightBodyByBodySystem = false; 6587 // $rootScope.isHighlightBodyByBodySystem = false;
6572 6588
6573 - 6589 + //Remove the Search list and then Repopulate it on change of Gender
  6590 + $('#searchListDiv').empty()
6574 6591
6575 $rootScope.isGenderChnage = true; 6592 $rootScope.isGenderChnage = true;
6576 6593
@@ -6795,7 +6812,8 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo @@ -6795,7 +6812,8 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
6795 6812
6796 // $rootScope.isHighlightBodyByBodySystem = false; 6813 // $rootScope.isHighlightBodyByBodySystem = false;
6797 6814
6798 - 6815 + //Remove the search list and then Repopulate it on change of View
  6816 + $('#searchListDiv').empty()
6799 6817
6800 if ($rootScope.openViews.length > 0) { 6818 if ($rootScope.openViews.length > 0) {
6801 $rootScope.openViews.splice($rootScope.openViews.length - 1); 6819 $rootScope.openViews.splice($rootScope.openViews.length - 1);
@@ -8169,6 +8187,21 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo @@ -8169,6 +8187,21 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
8169 } 8187 }
8170 } 8188 }
8171 8189
  8190 + $scope.resetSearchListView = function () {
  8191 +
  8192 + //Remove the list and then Repopulate it on change of $scope.searchFilter
  8193 + $('#searchListDiv').empty()
  8194 + // added the timeout to delay the compile of ul li
  8195 + $timeout(function () {
  8196 + 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}">' +
  8197 + '<a id="{{item._ActualTermNumber}}" href="" onclick="selectTerm(event)">{{item._TermText}}</a>' +
  8198 + ' </li></ul>').appendTo('#searchListDiv')
  8199 + $compile($e2)($scope);
  8200 + }, 500);
  8201 +
  8202 +
  8203 + }
  8204 +
8172 8205
8173 }] 8206 }]
8174 8207
400-SOURCECODE/AIAHTML5.Web/app/views/da/da-view.html
@@ -280,17 +280,16 @@ @@ -280,17 +280,16 @@
280 <div class=""> 280 <div class="">
281 <div class="input-group col-sm-8 col-xs-7 col-md-10 pull-left"> 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 <div id="backdrop" ng-show="IsSearchVisible"> 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 <!--#Bug 6591--> 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 <li ng-repeat="item in VocabTermTxt| filter:{ _TermText: searchFilter}"> 289 <li ng-repeat="item in VocabTermTxt| filter:{ _TermText: searchFilter}">
290 - <!--<a id="{{item._ActualTermNumber}}" href="" ng-click="jumpToTerm($event)">{{item._TermText}}</a>-->  
291 <a id="{{item._ActualTermNumber}}" href="" onclick="selectTerm(event)">{{item._TermText}}</a> 290 <a id="{{item._ActualTermNumber}}" href="" onclick="selectTerm(event)">{{item._TermText}}</a>
292 </li> 291 </li>
293 - </ul> 292 + </ul>-->
294 </div> 293 </div>
295 </div> 294 </div>
296 <!--</div>--> 295 <!--</div>-->