Commit cb860f556188c95be17c12e6b2b3498dae89c84e

Authored by Amrita Vishnoi
2 parents e99d0a54 4d0f7dfb

Merge branch 'Develop' of http://52.6.196.163/ADAM/AIAHTML5 into Develop

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) {
... ... @@ -2763,9 +2767,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
2763 2767 // $rootScope.isListManagerSelected = false;
2764 2768  
2765 2769 $rootScope.CloseListManager();
2766   -
2767   -
2768   -
  2770 +
2769 2771 $scope.isLayerChange = true;
2770 2772 $rootScope.isLoading = true;
2771 2773 $('#spinner').css('visibility', 'visible');
... ... @@ -6924,6 +6926,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
6924 6926 $scope.female = "active";
6925 6927 }
6926 6928 $rootScope.CloseAnnotationTool();
  6929 + $scope.searchFilter = '';
6927 6930 }
6928 6931  
6929 6932 //clsoe worker process
... ... @@ -7046,7 +7049,6 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
7046 7049  
7047 7050 //Remove the search list and then Repopulate it on change of View
7048 7051 $('#searchListDiv').empty()
7049   -
7050 7052 if ($rootScope.openViews.length > 0) {
7051 7053 $rootScope.openViews.splice($rootScope.openViews.length - 1);
7052 7054 }
... ... @@ -7132,6 +7134,14 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
7132 7134  
7133 7135 //2.
7134 7136 $scope.loadNavigatorForSelectedBodyView($rootScope.voId);
  7137 + //3. load corresponding navigator man
  7138 + $scope.loadNavigatorForSelectedBodyView($rootScope.voId);
  7139 +
  7140 + //4. change the search terms as per the selected bodyview
  7141 + $scope.loadSearchDataForBodyView();
  7142 +
  7143 + //5.Change the popup title next to search
  7144 + $scope.currentTitleFromJson = localStorage.getItem("currentViewTitle");
7135 7145 };
7136 7146  
7137 7147  
... ... @@ -7209,7 +7219,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
7209 7219 }
7210 7220 //13573 : DA > Annotations should not be display if we change the body view.
7211 7221 $rootScope.CloseAnnotationTool();
7212   -
  7222 + $scope.searchFilter = '';
7213 7223 }
7214 7224  
7215 7225 //Reload DA controller event listener after setting change
... ... @@ -7626,22 +7636,22 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
7626 7636 if ($("#btnExtract").hasClass("btn-primary")) {
7627 7637 $("#btnExtract").removeClass("btn-primary");
7628 7638 }
7629   -
  7639 +
7630 7640 if ($("#btnNormalMode").hasClass("btn-primary")) {
7631 7641 $("#btnNormalMode").removeClass("btn-primary");
7632 7642 }
7633 7643  
7634 7644 }
7635   -
  7645 + $rootScope.isSearchInputClicked = true;
7636 7646 $scope.ShowSearch = function () {
7637   -
7638 7647 console.log('ShowSearch is called');
7639 7648 //this check is for log only because we are writing length so need to check if its not null or undefined
7640 7649 if ($scope.VocabTermTxt != null || $scope.VocabTermTxt != undefined)
7641   - console.log('$scope.VocabTermTxt.length= ' + $scope.VocabTermTxt.length)
  7650 + console.log('$scope.VocabTermTxt.length= ' + $scope.VocabTermTxt.length)
7642 7651  
7643 7652 $timeout(function () {
7644   - if (($scope.VocabTermTxt!=null|| $scope.VocabTermTxt!=undefined) && ($scope.VocabTermTxt.length > 0)) {
  7653 + if (($scope.VocabTermTxt != null || $scope.VocabTermTxt != undefined) && ($scope.VocabTermTxt.length > 0)) {
  7654 +
7645 7655 $scope.IsSearchVisible = true;
7646 7656 document.getElementById("termlistfilter").style.display = "block";
7647 7657 }
... ... @@ -7651,35 +7661,34 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
7651 7661 $scope.ShowSearch();
7652 7662 }
7653 7663 }
7654   - }, 500);
  7664 +
  7665 + if ($rootScope.isSearchInputClicked == true) {
  7666 + $rootScope.isSearchInputClicked = false;
  7667 + $rootScope.searchListArray = [];
  7668 + $("#backdrop > #searchListDiv > #termlistfilter > li").each(function (key, value) {
  7669 + $rootScope.searchListArray.push({ "name": $(this).find("a").html(), "id": $(this).find("a").attr("id") });
  7670 + });
7655 7671  
7656   - //$scope.IsSearchVisible = true;
  7672 + }
  7673 +
  7674 + }, 500);
7657 7675  
7658   - //document.getElementById("termlistfilter").style.display = "block";
7659 7676 }
7660 7677  
  7678 +
7661 7679 $scope.HideSearch = function () {
7662   - if ($("#backdrop").is(":hover") || $("#termlistfilter").is(":hover") || $("#typedtermname").is(":focus")) {
7663   - $scope.IsSearchVisible = true;
7664   - document.getElementById("termlistfilter").style.display = "block";
7665   - }
7666   - else {
7667   - //1. persist term in DAsearch but hide ul/li
7668   - if ($("#btnDATermSearch").is(":hover")) {
7669   - $scope.IsSearchVisible = false;
7670   - }
7671   - else {
7672   - //2.hide ul/li and clear DA search
7673   - $scope.IsSearchVisible = false;
7674   - document.getElementById("termlistfilter").style.display = "none";
7675   - $scope.searchFilter = "";
7676   - }
7677   - }
  7680 +
  7681 + $timeout(function () {
  7682 +
  7683 + $("#termlistfilter").css("display", "none");
  7684 +
  7685 +
  7686 + }, 1000);
7678 7687  
7679 7688 }
7680 7689  
7681 7690 $scope.jumpToTerm = function (event) {
7682   - // alert(event.currentTarget.value);
  7691 +
7683 7692 $rootScope.searchSelectedText = $('#'+ event.currentTarget.id).text();
7684 7693 $('#termList option[selected="selected"]').prop("selected", false);
7685 7694 $('#termList option[value="' + $rootScope.searchSelectedText + '"]').prop("selected", true);
... ... @@ -8402,7 +8411,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
8402 8411 $("#btnNormalMode").removeClass("btn-primary");
8403 8412 }
8404 8413  
8405   - $('#typedtermname').val($scope.searchFilter);
  8414 + $('#typedTermName').val($scope.searchFilter);
8406 8415  
8407 8416 }
8408 8417 else {
... ... @@ -8417,21 +8426,62 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
8417 8426 }
8418 8427  
8419 8428 $scope.resetSearchListView = function () {
8420   -
  8429 +
  8430 + $("#termlistfilter").css("display", "block");
8421 8431 //Remove the list and then Repopulate it on change of $scope.searchFilter
8422   - $('#searchListDiv').empty()
  8432 + $('#searchListDiv').empty();
  8433 + $rootScope.ModifiedsearchListArray = [];
8423 8434 // added the timeout to delay the compile of ul li
8424   - $timeout(function () {
8425   - 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}">' +
8426   - '<a id="{{item._ActualTermNumber}}" href="" onclick="selectTerm(event)">{{item._TermText}}</a>' +
8427   - ' </li></ul>').appendTo('#searchListDiv')
8428   - $compile($e2)($scope);
8429   - }, 500);
8430   -
  8435 + $scope.IsSearchVisible = true;
  8436 + var isValueMatchedWithTerm = false;
  8437 + for (var i = 0; i <= $rootScope.searchListArray.length - 1; i++)
  8438 + {
  8439 + var searchFieldVal = $("#typedTermName").val();
  8440 + if (searchFieldVal.length > 0) {
  8441 +
  8442 + for (var j = 0; j <= searchFieldVal.length - 1; j++) {
  8443 +
  8444 + if (searchFieldVal[j].toUpperCase() != $rootScope.searchListArray[i].name[j].toUpperCase()) {
  8445 + isValueMatchedWithTerm = false;
  8446 + break;
  8447 + }
  8448 + else {
  8449 + isValueMatchedWithTerm = true
  8450 + }
  8451 + }
  8452 + if (isValueMatchedWithTerm == true) {
  8453 + $rootScope.ModifiedsearchListArray.push({ "name": $rootScope.searchListArray[i].name, "id": $rootScope.searchListArray[i].id});
  8454 + console.log($rootScope.ModifiedsearchListArray);
  8455 + }
  8456 +
  8457 + }
  8458 + }
  8459 +
  8460 + var termListFilterHtml = '';
  8461 + termListFilterHtml += '<ul id="termlistfilter" class="form-control dropdown-menu" style="height:90px;width:100%;overflow-y:scroll;position:absolute;z-index:60001;">';
  8462 + if ($("#typedTermName").val().length > 0) {
8431 8463  
  8464 + for (var i = 0; i <= $rootScope.ModifiedsearchListArray.length - 1; i++) {
  8465 +
  8466 + termListFilterHtml += '<li><a id=' + $rootScope.ModifiedsearchListArray[i].id + ' href="javascript:void(0);" onclick="selectTerm(event)">' + $rootScope.ModifiedsearchListArray[i].name + '</a></li>';
  8467 + }
  8468 + termListFilterHtml += '</ul>';
  8469 + $('#searchListDiv').append(termListFilterHtml);
  8470 +
  8471 + }
  8472 + else
  8473 + {
  8474 + console.log($rootScope.searchListArray.length);
  8475 + for (var i = 0; i <= $rootScope.searchListArray.length - 1; i++) {
  8476 +
  8477 + termListFilterHtml += '<li><a id=' + $rootScope.searchListArray[i].id + ' href="javascript:void(0);" onclick="selectTerm(event)">' + $rootScope.searchListArray[i].name + '</a></li>';
  8478 + }
  8479 + termListFilterHtml += '</ul>';
  8480 + $('#searchListDiv').append(termListFilterHtml);
  8481 +
  8482 + }
8432 8483 }
8433   -
8434   -
  8484 +
8435 8485 }]
8436 8486  
8437 8487 );
... ...
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="HideSearch()" 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  
... ...