Commit 7aa8951949aaf8380b91809d8f693a18b572f006
1 parent
d57217d0
added search code. need to highlight on seacr
Showing
3 changed files
with
46 additions
and
10 deletions
400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js
... | ... | @@ -1322,6 +1322,8 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo |
1322 | 1322 | $scope.skinTone = $rootScope.globalSetting.ethnicity; |
1323 | 1323 | |
1324 | 1324 | var SelectedLayerData = []; |
1325 | + //as the data statrs with zero index and we have layer 331 on 0 index in json so we get the | |
1326 | + //desired layer data by using below line of code. | |
1325 | 1327 | SelectedLayerData = $rootScope.BodyLayerData.Layers.DataLayer[dataLength - $scope.userInput - 1]; |
1326 | 1328 | if ((SelectedLayerData != null || SelectedLayerData != undefined)) |
1327 | 1329 | ... | ... |
400-SOURCECODE/AIAHTML5.Web/app/controllers/TileViewListController.js
... | ... | @@ -995,6 +995,40 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo |
995 | 995 | $rootScope.isLoading = false; |
996 | 996 | $('#setting-spinner').css('visibility', 'hidden'); |
997 | 997 | |
998 | + $scope.pinTermData = []; | |
999 | + var primaryLexicon = $rootScope.lexiconLanguageArray[0].id; | |
1000 | + $scope.matchedLanguageTermData = new jinqJs() | |
1001 | + .from($scope.AAPinTermData) | |
1002 | + .where('_LanguageId == ' + primaryLexicon) | |
1003 | + .select(); | |
1004 | + | |
1005 | + for (var i = 0; i < $scope.matchedLanguageTermData.length; i++) { | |
1006 | + $scope.pinTermData.push({ "LanguageId": $scope.matchedLanguageTermData[i]._LanguageId, "TermNumber": $scope.matchedLanguageTermData[i]._TermNumber, "TermTxt": $scope.matchedLanguageTermData[i]._TermText }); | |
1007 | + | |
1008 | + } | |
1009 | + $scope.$watch('$$scope.pinTermData', function (newValue, oldValue, scope) { | |
1010 | + if ($('#termlistfilter').html() != "") | |
1011 | + $('#termlistfilter').empty() | |
1012 | + if ($scope.pinTermData.length > 0) { | |
1013 | + $timeout(function () { | |
1014 | + console.log('pinTermData= ' + $scope.pinTermData.length); | |
1015 | + | |
1016 | + for (var j = 0; j < $scope.pinTermData.length; j++) { | |
1017 | + var $el = $('<li><a id= "'+$scope.pinTermData[j].TermNumber+'" href="" >'+$scope.pinTermData[j].TermTxt+'</a></li>').appendTo('#termlistfilter') | |
1018 | + $compile($el)($scope); | |
1019 | + | |
1020 | + } | |
1021 | + | |
1022 | + | |
1023 | + //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 $scope.pinTermData">' + | |
1024 | + // '<a id="{{item.TermNumber}}" href="" onclick="selectTerm(event)">{{item.TermTxt}}</a>' + | |
1025 | + // ' </li></ul>').appendTo('#searchListDivAA') | |
1026 | + //$compile($e2)($scope); | |
1027 | + | |
1028 | + }, 500); | |
1029 | + } | |
1030 | + }) | |
1031 | + | |
998 | 1032 | }, |
999 | 1033 | function (error) { |
1000 | 1034 | // handle errors here |
... | ... | @@ -1120,7 +1154,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo |
1120 | 1154 | |
1121 | 1155 | |
1122 | 1156 | $scope.showItemsForSearch = function () { |
1123 | - console.log('ShowSearch is called'); | |
1157 | + console.log('showItemsForSearch is called'); | |
1124 | 1158 | //this check is for log only because we are writing length so need to check if its not null or undefined |
1125 | 1159 | |
1126 | 1160 | |
... | ... | @@ -1128,19 +1162,19 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo |
1128 | 1162 | if (($scope.AAPinTermData != null || $scope.AAPinTermData != undefined) && ($scope.AAPinTermData.length > 0)) { |
1129 | 1163 | |
1130 | 1164 | $scope.IsSearchVisible = true; |
1131 | - // document.getElementById("termlistfilter").style.display = "block"; | |
1165 | + document.getElementById("termlistfilter").style.display = "block"; | |
1132 | 1166 | } |
1133 | 1167 | else { |
1134 | 1168 | $rootScope.loadSearchData(); |
1135 | 1169 | if ($scope.AAPinTermData.length > 0) { |
1136 | - $scope.ShowSearch(); | |
1170 | + $scope.showItemsForSearch(); | |
1137 | 1171 | } |
1138 | 1172 | } |
1139 | 1173 | |
1140 | 1174 | if ($rootScope.isSearchInputClicked == true) { |
1141 | 1175 | $rootScope.isSearchInputClicked = false; |
1142 | 1176 | $rootScope.searchListArray = []; |
1143 | - $("#backdrop > #searchListDiv > #termlistfilter > li").each(function (key, value) { | |
1177 | + $("#backdrop > #searchListDivAA > #termlistfilter > li").each(function (key, value) { | |
1144 | 1178 | $rootScope.searchListArray.push({ "name": $(this).find("a").html(), "id": $(this).find("a").attr("id") }); |
1145 | 1179 | }); |
1146 | 1180 | |
... | ... | @@ -1176,10 +1210,10 @@ function showAllPins(event) { |
1176 | 1210 | }); |
1177 | 1211 | } |
1178 | 1212 | |
1179 | -function onSearch(event) { | |
1180 | - | |
1213 | +function OnSearchAA(event) { | |
1214 | + console.log('AA search is called') | |
1181 | 1215 | var scope = angular.element(document.getElementById("aaDetailPageDiv")).scope(); |
1182 | 1216 | scope.$apply(function () { |
1183 | - scope.showSItemsForearch(); | |
1217 | + scope.showItemsForSearch(); | |
1184 | 1218 | }); |
1185 | 1219 | } |
1186 | 1220 | \ No newline at end of file | ... | ... |
400-SOURCECODE/AIAHTML5.Web/app/views/aa/atlas-anatomy-detail.html
... | ... | @@ -76,11 +76,11 @@ |
76 | 76 | <option>Anterior intercostal vein</option> |
77 | 77 | </select>--> |
78 | 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..."> | |
79 | + <input type="text" class="form-control input-sm pull-left" id="typedTermName" onclick="OnSearchAA()" ondblclick="OnSearchAA()" ng-model="searchFilter" placeholder=" search..."> | |
80 | 80 | |
81 | 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 | - | |
82 | + <div id="searchListDivAA" class="col-sm-12 col-xs-12 col-md-12 col-lg-12 pull-left"> | |
83 | + <ul id="termlistfilter" class="form-control dropdown-menu" style="height:90px;width:100%;overflow-y:scroll;position:absolute;display:none;z-index:60001;"></ul> | |
84 | 84 | </div> |
85 | 85 | </div> |
86 | 86 | </div> | ... | ... |