Commit d57217d03cce10cd210e45f544f710f135bb7a23

Authored by Nikita Kulshreshtha
1 parent fa3bdbe8

added search code

400-SOURCECODE/AIAHTML5.Web/app/controllers/TileViewListController.js
@@ -1051,36 +1051,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo @@ -1051,36 +1051,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
1051 } 1051 }
1052 } 1052 }
1053 1053
1054 - //var Annotation;  
1055 - //$scope.ActualTermNo = actualTermNo;  
1056 - //for (var j = 0; j <= $rootScope.vocabTermDataArray.length - 1; j++) {  
1057 -  
1058 - // if ($rootScope.vocabTermDataArray[j].language == language) {  
1059 -  
1060 - // if ($rootScope.vocabTermDataArray[j].VocabTermData != null || $rootScope.vocabTermDataArray[j].VocabTermData != undefined) {  
1061 - // $scope.matchedActualTermData = new jinqJs()  
1062 - // .from($rootScope.vocabTermDataArray[j].VocabTermData.VocabTerms.Term)  
1063 - // .where('_ActualTermNumber == ' + actualTermNo)  
1064 - // .select();  
1065 -  
1066 - // if ($scope.matchedActualTermData != null || $scope.matchedActualTermData != undefined) {  
1067 - // for (var z = 0; z <= $scope.matchedActualTermData.length; z++) {  
1068 - // //send actual term no to get the term text.  
1069 - // Annotation = $scope.matchedActualTermData[0]._TermText;  
1070 - // // alert("Annotation : " + Annotation);  
1071 - // break;  
1072 - // };  
1073 - // }  
1074 - // return Annotation;  
1075 - // }  
1076 -  
1077 - // else {  
1078 - // return null;  
1079 - // }  
1080 -  
1081 - // }  
1082 - //}  
1083 - 1054 +
1084 1055
1085 1056
1086 1057
@@ -1146,6 +1117,39 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo @@ -1146,6 +1117,39 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
1146 }).drawLayers(); 1117 }).drawLayers();
1147 }) 1118 })
1148 } 1119 }
  1120 +
  1121 +
  1122 + $scope.showItemsForSearch = function () {
  1123 + console.log('ShowSearch is called');
  1124 + //this check is for log only because we are writing length so need to check if its not null or undefined
  1125 +
  1126 +
  1127 + $timeout(function () {
  1128 + if (($scope.AAPinTermData != null || $scope.AAPinTermData != undefined) && ($scope.AAPinTermData.length > 0)) {
  1129 +
  1130 + $scope.IsSearchVisible = true;
  1131 + // document.getElementById("termlistfilter").style.display = "block";
  1132 + }
  1133 + else {
  1134 + $rootScope.loadSearchData();
  1135 + if ($scope.AAPinTermData.length > 0) {
  1136 + $scope.ShowSearch();
  1137 + }
  1138 + }
  1139 +
  1140 + if ($rootScope.isSearchInputClicked == true) {
  1141 + $rootScope.isSearchInputClicked = false;
  1142 + $rootScope.searchListArray = [];
  1143 + $("#backdrop > #searchListDiv > #termlistfilter > li").each(function (key, value) {
  1144 + $rootScope.searchListArray.push({ "name": $(this).find("a").html(), "id": $(this).find("a").attr("id") });
  1145 + });
  1146 +
  1147 + }
  1148 +
  1149 + }, 500);
  1150 +
  1151 + }
  1152 +
1149 }]); 1153 }]);
1150 1154
1151 function showSelectedSystemPins(event) { 1155 function showSelectedSystemPins(event) {
@@ -1170,4 +1174,12 @@ function showAllPins(event) { @@ -1170,4 +1174,12 @@ function showAllPins(event) {
1170 scope.$apply(function () { 1174 scope.$apply(function () {
1171 scope.showAllPinsAfterHide(event); 1175 scope.showAllPinsAfterHide(event);
1172 }); 1176 });
  1177 +}
  1178 +
  1179 +function onSearch(event) {
  1180 +
  1181 + var scope = angular.element(document.getElementById("aaDetailPageDiv")).scope();
  1182 + scope.$apply(function () {
  1183 + scope.showSItemsForearch();
  1184 + });
1173 } 1185 }
1174 \ No newline at end of file 1186 \ No newline at end of file
400-SOURCECODE/AIAHTML5.Web/app/views/aa/atlas-anatomy-detail.html
@@ -66,7 +66,7 @@ @@ -66,7 +66,7 @@
66 <div class="breadcrumb"> 66 <div class="breadcrumb">
67 <div class=""> 67 <div class="">
68 <div class="input-group col-sm-8 col-xs-7 col-md-10 pull-left"> 68 <div class="input-group col-sm-8 col-xs-7 col-md-10 pull-left">
69 - <input class="form-control input-sm " type="text" placeholder="Anterior cutaneous branch of first intercostal nerve"> 69 + <!--<input class="form-control input-sm " type="text" placeholder="Anterior cutaneous branch of first intercostal nerve">-->
70 <!--<select class="form-control input-sm "> 70 <!--<select class="form-control input-sm ">
71 <option>---Select---</option> 71 <option>---Select---</option>
72 <option selected>Anterior cutaneous branch of first intercostal nerve</option> 72 <option selected>Anterior cutaneous branch of first intercostal nerve</option>
@@ -76,6 +76,13 @@ @@ -76,6 +76,13 @@
76 <option>Anterior intercostal vein</option> 76 <option>Anterior intercostal vein</option>
77 </select>--> 77 </select>-->
78 <!--<div class="input-group-addon btn btn-primary btn-sm"></div>--> 78 <!--<div class="input-group-addon btn btn-primary btn-sm"></div>-->
  79 + <input type="text" class="form-control input-sm pull-left" id="typedTermName" onclick="OnSearch()" ondblclick="OnSearch()" ng-model="searchFilter" placeholder=" search...">
  80 +
  81 + <div id="backdrop" ng-show="IsSearchVisible">
  82 + <div id="searchListDiv" class="col-sm-12 col-xs-12 col-md-12 col-lg-12 pull-left">
  83 +
  84 + </div>
  85 + </div>
79 </div> 86 </div>
80 &nbsp; 87 &nbsp;
81 <!-- Single button --> 88 <!-- Single button -->