Commit 8035bc3f61ac68bac0975dbcc5b562bdfd16c5a3

Authored by Nikita Kulshreshtha
2 parents ee3c0e26 b952a635

Merge branch 'SearchIssue' into Develop

400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js
... ... @@ -634,6 +634,24 @@ 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 + if ($('#searchListDiv').html()!="")
  643 + $('#searchListDiv').empty()
  644 + //Delay compile of ul li so that the remove of li is completed.
  645 + $timeout(function () {
  646 + 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}">' +
  647 + '<a id="{{item._ActualTermNumber}}" href="" onclick="selectTerm(event)">{{item._TermText}}</a>' +
  648 + ' </li></ul>').appendTo('#searchListDiv')
  649 + $compile($e2)($scope);
  650 +
  651 + }, 500);
  652 +
  653 + }, true);
  654 +
637 655 }
638 656  
639 657 $scope.loadBodyViewData = function (currentVoid) {
... ... @@ -6562,7 +6580,8 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
6562 6580  
6563 6581 // $rootScope.isHighlightBodyByBodySystem = false;
6564 6582  
6565   -
  6583 + //Remove the Search list and then Repopulate it on change of Gender
  6584 + $('#searchListDiv').empty()
6566 6585  
6567 6586 $rootScope.isGenderChnage = true;
6568 6587  
... ... @@ -6791,7 +6810,8 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
6791 6810  
6792 6811 // $rootScope.isHighlightBodyByBodySystem = false;
6793 6812  
6794   -
  6813 + //Remove the search list and then Repopulate it on change of View
  6814 + $('#searchListDiv').empty()
6795 6815  
6796 6816 if ($rootScope.openViews.length > 0) {
6797 6817 $rootScope.openViews.splice($rootScope.openViews.length - 1);
... ... @@ -7525,7 +7545,10 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
7525 7545 console.log('listManagerEvent');
7526 7546 var systemList = $rootScope.CommonData.DACommonData.BodySystems.Item;
7527 7547  
7528   - $('#bodySystems').empty();
  7548 + var optionsLength = $('#bodySystems option').length;//.children('option').length;
  7549 + console.log('optionsLength= ' + optionsLength)
  7550 + if (optionsLength>0)
  7551 + $('#bodySystems').empty();
7529 7552  
7530 7553  
7531 7554 var $all = $('<option id="0" selected="">All</option>').appendTo('#bodySystems');
... ... @@ -7559,7 +7582,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
7559 7582 }
7560 7583  
7561 7584 }
7562   -
  7585 +
7563 7586  
7564 7587  
7565 7588 });
... ... @@ -8171,6 +8194,21 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
8171 8194 }
8172 8195 }
8173 8196  
  8197 + $scope.resetSearchListView = function () {
  8198 +
  8199 + //Remove the list and then Repopulate it on change of $scope.searchFilter
  8200 + $('#searchListDiv').empty()
  8201 + // added the timeout to delay the compile of ul li
  8202 + $timeout(function () {
  8203 + 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}">' +
  8204 + '<a id="{{item._ActualTermNumber}}" href="" onclick="selectTerm(event)">{{item._TermText}}</a>' +
  8205 + ' </li></ul>').appendTo('#searchListDiv')
  8206 + $compile($e2)($scope);
  8207 + }, 500);
  8208 +
  8209 +
  8210 + }
  8211 +
8174 8212  
8175 8213 }]
8176 8214  
... ...
400-SOURCECODE/AIAHTML5.Web/app/views/da/da-view.html
... ... @@ -280,31 +280,17 @@
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">
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;">
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>
292   - </li>
293   - </ul>
  286 + <div id="searchListDiv" class="col-sm-12 col-xs-12 col-md-12 col-lg-12 pull-left">
  287 +
294 288 </div>
295 289 </div>
296   - <!--</div>-->
297 290  
298 291 </div>
299 292 <div class="btn-group">
300   - <!--<button type="button" style="padding:0px 0px 10px 1px !important;background-color:rgba(255,255,255,0.0); border:none;" class="btn btn-success dropdown-toggle btn-sm" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
301   - <img src="~/../content/images/DA/go-to.png" style="height: 30px;width:50px">
302   - </button>
303   - <ul class="dropdown-menu" style="width:100%;">
304   - <li><a href="#">{{currentTitleFromJson}}</a></li>
305   - <li role="separator" class="divider"></li>
306   - <li><a href="#">All</a></li>
307   - </ul>-->
  293 +
308 294 <button type="button" id="btnDATermSearch" style="padding:0px 0px 10px 1px !important;background-color:rgba(255,255,255,0.0); border:none;" class="btn btn-success btn-sm" ng-mousedown="OnSearchBtnClick($event)">
309 295 <img src="~/../content/images/DA/go-to.png" style="height: 30px;width:50px">
310 296 </button>
... ... @@ -316,7 +302,7 @@
316 302  
317 303 <div class="dropdown-menu active" id="navigatorDiv" style="min-height:auto; min-width:auto; ">
318 304 <div id="containment-wrapper" align="center" style="min-width:auto;height:119px; ">
319   - <img id="navimg" alt=""></img>
  305 + <img id="navimg" alt=""/>
320 306 <div id="draggable" class="draggable ui-widget-content" ng-mouseup="ScrollCanvasDiv()" ng-style="dragdivposition">
321 307 </div>
322 308 </div>
... ...