Commit bb3714dd3e4bb4b35e66346a93b41efa23a2275f

Authored by unknown
1 parent d57e03c5

DA > Search List > Search List drop-down is not appear when type the body struct…

…ure name in the search text field
400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js
... ... @@ -563,7 +563,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
563 563 value: 0,
564 564 slide: function (event, ui) {
565 565 // $("#txtlayerNumber").val(100 - ui.value); // basic math operation..
566   -
  566 +
567 567 // $("#txtlayerNumber").val($("#layerChangeSlider").slider("value"));
568 568 },
569 569 stop: function (event, ui) {
... ... @@ -614,11 +614,13 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
614 614 }
615 615 }
616 616 }
617   - });
  617 + });
  618 +
  619 +
618 620 })
619 621  
620 622 $scope.loadSearchDataForBodyView = function () {
621   -
  623 +
622 624 console.log('loadSearchDataForBodyView');
623 625  
624 626 var currentBodyViewId = localStorage.getItem("currentBodyViewId");
... ... @@ -684,11 +686,13 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
684 686 '<a id="{{item._ActualTermNumber}}" href="" onclick="selectTerm(event)">{{item._TermText}}</a>' +
685 687 ' </li></ul>').appendTo('#searchListDiv')
686 688 $compile($e2)($scope);
687   -
  689 +
688 690 }, 500);
689   -
  691 +
690 692 }, true);
691 693  
  694 +
  695 +
692 696 }
693 697  
694 698 $scope.loadBodyViewData = function (currentVoid) {
... ... @@ -2761,9 +2765,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
2761 2765 // $rootScope.isListManagerSelected = false;
2762 2766  
2763 2767 $rootScope.CloseListManager();
2764   -
2765   -
2766   -
  2768 +
2767 2769 $scope.isLayerChange = true;
2768 2770 $rootScope.isLoading = true;
2769 2771 $('#spinner').css('visibility', 'visible');
... ... @@ -6921,6 +6923,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
6921 6923 $scope.female = "active";
6922 6924 }
6923 6925 $rootScope.CloseAnnotationTool();
  6926 + $scope.searchFilter = '';
6924 6927 }
6925 6928  
6926 6929 //clsoe worker process
... ... @@ -7043,7 +7046,6 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
7043 7046  
7044 7047 //Remove the search list and then Repopulate it on change of View
7045 7048 $('#searchListDiv').empty()
7046   -
7047 7049 if ($rootScope.openViews.length > 0) {
7048 7050 $rootScope.openViews.splice($rootScope.openViews.length - 1);
7049 7051 }
... ... @@ -7129,6 +7131,14 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
7129 7131  
7130 7132 //2.
7131 7133 $scope.loadNavigatorForSelectedBodyView($rootScope.voId);
  7134 + //3. load corresponding navigator man
  7135 + $scope.loadNavigatorForSelectedBodyView($rootScope.voId);
  7136 +
  7137 + //4. change the search terms as per the selected bodyview
  7138 + $scope.loadSearchDataForBodyView();
  7139 +
  7140 + //5.Change the popup title next to search
  7141 + $scope.currentTitleFromJson = localStorage.getItem("currentViewTitle");
7132 7142 };
7133 7143  
7134 7144  
... ... @@ -7206,7 +7216,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
7206 7216 }
7207 7217 //13573 : DA > Annotations should not be display if we change the body view.
7208 7218 $rootScope.CloseAnnotationTool();
7209   -
  7219 + $scope.searchFilter = '';
7210 7220 }
7211 7221  
7212 7222 //Reload DA controller event listener after setting change
... ... @@ -7623,22 +7633,22 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
7623 7633 if ($("#btnExtract").hasClass("btn-primary")) {
7624 7634 $("#btnExtract").removeClass("btn-primary");
7625 7635 }
7626   -
  7636 +
7627 7637 if ($("#btnNormalMode").hasClass("btn-primary")) {
7628 7638 $("#btnNormalMode").removeClass("btn-primary");
7629 7639 }
7630 7640  
7631 7641 }
7632   -
  7642 + $rootScope.IsSearchInputClicked = true;
7633 7643 $scope.ShowSearch = function () {
7634   -
7635 7644 console.log('ShowSearch is called');
7636 7645 //this check is for log only because we are writing length so need to check if its not null or undefined
7637 7646 if ($scope.VocabTermTxt != null || $scope.VocabTermTxt != undefined)
7638   - console.log('$scope.VocabTermTxt.length= ' + $scope.VocabTermTxt.length)
  7647 + console.log('$scope.VocabTermTxt.length= ' + $scope.VocabTermTxt.length)
7639 7648  
7640 7649 $timeout(function () {
7641   - if (($scope.VocabTermTxt!=null|| $scope.VocabTermTxt!=undefined) && ($scope.VocabTermTxt.length > 0)) {
  7650 + if (($scope.VocabTermTxt != null || $scope.VocabTermTxt != undefined) && ($scope.VocabTermTxt.length > 0)) {
  7651 +
7642 7652 $scope.IsSearchVisible = true;
7643 7653 document.getElementById("termlistfilter").style.display = "block";
7644 7654 }
... ... @@ -7648,13 +7658,21 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
7648 7658 $scope.ShowSearch();
7649 7659 }
7650 7660 }
7651   - }, 500);
  7661 +
  7662 + if ($rootScope.IsSearchInputClicked == true) {
  7663 + $rootScope.IsSearchInputClicked = false;
  7664 + $rootScope.searchListArray = [];
  7665 + $("#backdrop > #searchListDiv > #termlistfilter > li").each(function (key, value) {
  7666 + $rootScope.searchListArray.push({ "name": $(this).find("a").html(), "id": $(this).find("a").attr("id") });
  7667 + });
7652 7668  
7653   - //$scope.IsSearchVisible = true;
  7669 + }
  7670 +
  7671 + }, 500);
7654 7672  
7655   - //document.getElementById("termlistfilter").style.display = "block";
7656 7673 }
7657 7674  
  7675 +
7658 7676 $scope.HideSearch = function () {
7659 7677 if ($("#backdrop").is(":hover") || $("#termlistfilter").is(":hover") || $("#typedtermname").is(":focus")) {
7660 7678 $scope.IsSearchVisible = true;
... ... @@ -7676,7 +7694,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
7676 7694 }
7677 7695  
7678 7696 $scope.jumpToTerm = function (event) {
7679   - // alert(event.currentTarget.value);
  7697 +
7680 7698 $rootScope.searchSelectedText = $('#'+ event.currentTarget.id).text();
7681 7699 $('#termList option[selected="selected"]').prop("selected", false);
7682 7700 $('#termList option[value="' + $rootScope.searchSelectedText + '"]').prop("selected", true);
... ... @@ -8414,17 +8432,86 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
8414 8432 }
8415 8433  
8416 8434 $scope.resetSearchListView = function () {
8417   -
  8435 +
  8436 + $("#termlistfilter").css("display", "block");
8418 8437 //Remove the list and then Repopulate it on change of $scope.searchFilter
8419   - $('#searchListDiv').empty()
  8438 + $('#searchListDiv').empty();
  8439 + $rootScope.ModifiedsearchListArray = [];
8420 8440 // added the timeout to delay the compile of ul li
  8441 + $scope.IsSearchVisible = true;
  8442 +
  8443 + for (var i = 0; i <= $rootScope.searchListArray.length - 1; i++)
  8444 + {
  8445 + var searchFieldVal = $("#typedtermname").val();
  8446 + if (searchFieldVal.length > 0) {
  8447 + var flag = true;
  8448 + for (var j = 0; j <= searchFieldVal.length - 1; j++) {
  8449 +
  8450 + if (searchFieldVal[j].toUpperCase() != $rootScope.searchListArray[i].name[j].toUpperCase()) {
  8451 + flag = false;
  8452 + break;
  8453 + }
  8454 + }
  8455 + if (flag == true) {
  8456 + $rootScope.ModifiedsearchListArray.push({ "name": $rootScope.searchListArray[i].name, "id": $rootScope.searchListArray[i].id});
  8457 + console.log($rootScope.ModifiedsearchListArray);
  8458 + }
  8459 +
  8460 + }
  8461 + }
  8462 +
  8463 + var termListFilterHtml = '';
  8464 + termListFilterHtml += '<ul id="termlistfilter" class="form-control dropdown-menu" style="height:90px;width:100%;overflow-y:scroll;position:absolute;z-index:60001;">';
  8465 + if ($("#typedtermname").val().length > 0) {
  8466 +
  8467 + for (var i = 0; i <= $rootScope.ModifiedsearchListArray.length - 1; i++) {
  8468 +
  8469 + termListFilterHtml += '<li><a id=' + $rootScope.ModifiedsearchListArray[i].id + ' href="javascript:void(0);" onclick="selectTerm(event)">' + $rootScope.ModifiedsearchListArray[i].name + '</a></li>';
  8470 + }
  8471 + termListFilterHtml += '</ul>';
  8472 + $('#searchListDiv').append(termListFilterHtml);
  8473 +
  8474 + }
  8475 + else
  8476 + {
  8477 + console.log($rootScope.searchListArray.length);
  8478 + for (var i = 0; i <= $rootScope.searchListArray.length - 1; i++) {
  8479 +
  8480 + termListFilterHtml += '<li><a id=' + $rootScope.searchListArray[i].id + ' href="javascript:void(0);" onclick="selectTerm(event)">' + $rootScope.searchListArray[i].name + '</a></li>';
  8481 + }
  8482 + termListFilterHtml += '</ul>';
  8483 + $('#searchListDiv').append(termListFilterHtml);
  8484 +
  8485 + }
  8486 +
  8487 +
  8488 + //$timeout(function () {
  8489 +
  8490 +
  8491 + // var $e2 = $('<ul id="termlistfilter" class="form-control dropdown-menu" style="height:90px;width:100%;overflow-y:scroll;position:absolute;z-index:60001;"><li ng-repeat="item in VocabTermTxt| filter:{ _TermText: searchFilter}">' +
  8492 + // '<a href="#"></a>' +
  8493 + // ' </li></ul>').appendTo('#searchListDiv');
  8494 +
  8495 +
  8496 + // //var $e2 = $('<ul id="termlistfilter" class="form-control dropdown-menu" style="height:90px;width:100%;overflow-y:scroll;position:absolute;z-index:60001;"><li ng-repeat="item in VocabTermTxt| filter:{ _TermText: searchFilter}">' +
  8497 + // // '<a id="{{item._ActualTermNumber}}" href="" onclick="selectTerm(event)">{{item._TermText}}</a>' +
  8498 + // // ' </li></ul>').appendTo('#searchListDiv');
  8499 +
  8500 + // $compile($e2)($scope);
  8501 +
  8502 + //}, 500);
  8503 +
  8504 +
  8505 + }
  8506 +
  8507 + $rootScope.blurSearch = function () {
  8508 +
8421 8509 $timeout(function () {
8422   - var $e2 = $('<ul id="termlistfilter" class="form-control dropdown-menu" style="height:90px;width:100%;overflow-y:scroll;position:absolute;display:none;z-index:60001;"><li ng-repeat="item in VocabTermTxt| filter:{ _TermText: searchFilter}">' +
8423   - '<a id="{{item._ActualTermNumber}}" href="" onclick="selectTerm(event)">{{item._TermText}}</a>' +
8424   - ' </li></ul>').appendTo('#searchListDiv')
8425   - $compile($e2)($scope);
8426   - }, 500);
8427 8510  
  8511 + $("#termlistfilter").css("display", "none");
  8512 +
  8513 +
  8514 + }, 1000);
8428 8515  
8429 8516 }
8430 8517  
... ...
400-SOURCECODE/AIAHTML5.Web/app/views/da/da-view.html
... ... @@ -130,6 +130,7 @@
130 130 left: 0;
131 131 right: 0;
132 132 }
  133 +
133 134 </style>
134 135 <div class=" " id="daView" ng-controller="DAController">
135 136 <div class="pos-relative leftToolBar tools pull-left">
... ... @@ -268,14 +269,14 @@
268 269 <div class="">
269 270 <div class="input-group col-sm-8 col-xs-7 col-md-10 pull-left">
270 271  
271   - <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...">
  272 + <input type="text" class="form-control input-sm pull-left" id="typedtermname" onclick="OnSearch()" ondblclick="OnSearch()" ng-model="searchFilter" ng-change="resetSearchListView()" ng-blur="blurSearch()" placeholder=" search...">
272 273  
273 274 <div id="backdrop" ng-show="IsSearchVisible">
274 275 <div id="searchListDiv" class="col-sm-12 col-xs-12 col-md-12 col-lg-12 pull-left">
275 276  
276 277 </div>
277 278 </div>
278   -
  279 +
279 280 </div>
280 281 <div class="btn-group">
281 282  
... ...