Commit aaf82b2bd8125c23bb5656bdc3442504e8dd9edc

Authored by Nikita Kulshreshtha
1 parent 7aa89519

search is implemented

400-SOURCECODE/AIAHTML5.Web/app/controllers/TileViewListController.js
... ... @@ -489,7 +489,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
489 489  
490 490 })
491 491 //show annotation on first pin of the sysyem
492   - $scope.showAnnotation($scope.selectedSystemPinData, false, false);
  492 + $scope.showAnnotation($scope.selectedSystemPinData, false, false, false);
493 493 }
494 494 }
495 495 }
... ... @@ -503,7 +503,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
503 503 }
504 504 }
505 505  
506   - $scope.showAnnotation = function (selectedPinData, isCtrlPressed, isPinClicked) {
  506 + $scope.showAnnotation = function (selectedPinData, isCtrlPressed, isPinClicked, isItemSearched) {
507 507  
508 508 $scope.selectedPin = [];
509 509 var isSameTermWithMultiPin = false;
... ... @@ -520,30 +520,13 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
520 520  
521 521 $scope.MultiLanguageAnnationArray = [];
522 522  
523   - // get termText info
524   - // var promise = ModuleService.getTermTextDataForPin($scope.moduleName)
525   - //.then(
526   - // function (response) {
527   -
528   - // $scope.TermInfo = response.data.Terms.Term;
529   -
530   - // if ($scope.TermInfo != null && $scope.TermInfo.length > 0) {
531   -
532   - // var termTextdata = new jinqJs()
533   - // .from($scope.TermInfo)
534   - // .where("__ActualTermNumber == " + pinTermNumber)
535   - // .select();
536   -
537   - // var termText = termTextdata[0].__TermText;
538   - // $scope.MultiLanguageAnnationArray = [];
539   - // $scope.MultiLanguageAnnationArray.push(termText);
540 523 $scope.GetAnnotationBasedOnActualTermNo(pinTermNumber);
541 524  
542 525 if (isCtrlPressed) {
543 526  
544 527 }
545 528 else {
546   - if (isPinClicked) {
  529 + if (isPinClicked || isItemSearched) {
547 530 var existingSpeechBubble = $("div[id*='speechBubble']");
548 531 for (var i = 0; i < existingSpeechBubble.length; i++) {
549 532 existingSpeechBubble[i].parentNode.removeChild(existingSpeechBubble[i]);
... ... @@ -777,7 +760,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
777 760 speechBubbleDims.push({ currentX: x, currentY: y });
778 761 document.getElementById('speechBubbleLine' + PinId + '').style.display = 'block';
779 762 document.getElementById('speechBubbleLine' + PinId + '').style.left = ((speechBubbleDims[0].currentX - 45)) + 'px';
780   - document.getElementById('speechBubbleLine' + PinId + '').style.top = ((speechBubbleDims[0].currentY) - 40) + 'px';
  763 + document.getElementById('speechBubbleLine' + PinId + '').style.top = ((speechBubbleDims[0].currentY) - 20) + 'px';
781 764 document.getElementById('speechBubble' + PinId + '').style.display = 'block';
782 765 document.getElementById('speechBubble' + PinId + '').style.left = (speechBubbleDims[0].currentX - 70) + 'px';
783 766 document.getElementById('speechBubble' + PinId + '').style.top = (speechBubbleDims[0].currentY - 58) + 'px';
... ... @@ -934,11 +917,11 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
934 917 .where("_PinId == " + pinID)
935 918 .select();
936 919 if (clickedPin.event.ctrlKey == true) {
937   - $scope.showAnnotation(selectedPinData, true, true);
  920 + $scope.showAnnotation(selectedPinData, true, true, false);
938 921  
939 922 }
940 923 else {
941   - $scope.showAnnotation(selectedPinData, false, true);
  924 + $scope.showAnnotation(selectedPinData, false, true, false);
942 925  
943 926 }
944 927  
... ... @@ -974,18 +957,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
974 957  
975 958 $rootScope.loadSearchData = function () {
976 959  
977   - //var promise = ModuleService.getTermTextDataForPin($scope.moduleName)
978   - // .then(
979   - // function (response) {
980   -
981   - // $scope.TermInfo = response.data.Terms.Term;
982   -
983   - // },
984   - // function (error) {
985   - // // handle errors here
986   - // console.log(' error: ' + error.statusText);
987   - // }
988   - // )
  960 +
989 961 var imageId = $rootScope.imageId;
990 962 var promise = ModuleService.getTermTextDataForAAImage(imageId)
991 963 .then(
... ... @@ -1006,7 +978,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
1006 978 $scope.pinTermData.push({ "LanguageId": $scope.matchedLanguageTermData[i]._LanguageId, "TermNumber": $scope.matchedLanguageTermData[i]._TermNumber, "TermTxt": $scope.matchedLanguageTermData[i]._TermText });
1007 979  
1008 980 }
1009   - $scope.$watch('$$scope.pinTermData', function (newValue, oldValue, scope) {
  981 + $scope.$watch('$scope.pinTermData', function (newValue, oldValue, scope) {
1010 982 if ($('#termlistfilter').html() != "")
1011 983 $('#termlistfilter').empty()
1012 984 if ($scope.pinTermData.length > 0) {
... ... @@ -1014,17 +986,11 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
1014 986 console.log('pinTermData= ' + $scope.pinTermData.length);
1015 987  
1016 988 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')
  989 + var $el = $('<li><a id= "' + $scope.pinTermData[j].TermNumber + '" href="" onclick="onSearchItemSelection(event)" >' + $scope.pinTermData[j].TermTxt + '</a></li>').appendTo('#termlistfilter')
1018 990 $compile($el)($scope);
1019 991  
1020 992 }
1021 993  
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 994 }, 500);
1029 995 }
1030 996 })
... ... @@ -1064,24 +1030,13 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
1064 1030  
1065 1031 $scope.MultiLanguageAnnationArray.push(termText);
1066 1032  
1067   - ////1.
1068   - //var actualTermNo = 0;
1069   - //for (var z = 0; z < $scope.matchedTermNoData.length; z++) {
1070   - // //send actual term no to get the term text.
1071   - // actualTermNo = $scope.matchedTermNoData[0]._ActualTermNumber;
1072   - // annotationText = $scope.GetAnnotationBasedOnActualTermNo(actualTermNo, languageArray[j].language);
1073   - // annotation.push(annotationText);
1074   - // $rootScope.annotationText.push(annotationText);
1075   - // $rootScope.actualTermNumber = actualTermNo;
1076   - // break;
1077   - };
1078   -
1079   - //2.
  1033 +
  1034 + };
  1035 +
  1036 +
1080 1037  
1081 1038 }
1082   - else {
1083   - // send term no to vocab json data to get the text
1084   - }
  1039 +
1085 1040 }
1086 1041 }
1087 1042  
... ... @@ -1184,6 +1139,45 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
1184 1139  
1185 1140 }
1186 1141  
  1142 +
  1143 + $scope.HideSearchList = function () {
  1144 +
  1145 + $timeout(function () {
  1146 +
  1147 + $("#termlistfilter").css("display", "none");
  1148 +
  1149 +
  1150 + }, 1000);
  1151 +
  1152 + }
  1153 +
  1154 + $scope.highlightPinBasedOnSerachItem = function (event) {
  1155 + debugger;
  1156 + $scope.searchItemId = event.currentTarget.id;
  1157 + $scope.searchItemText = event.currentTarget.innerHTML;
  1158 + $('#termList option[selected="selected"]').prop("selected", false);
  1159 + $('#termList option[value="' + $rootScope.searchSelectedText + '"]').prop("selected", true);
  1160 + $("#termList").find("option").css({ "background-color": "#ffffff", "color": "#000000" });
  1161 + $('#termList option[value="' + $rootScope.searchSelectedText + '"]').css({ "background-color": "#3399FF", "color": "#ffffff" });
  1162 +
  1163 + $scope.searchFilter = event.currentTarget.innerHTML;
  1164 + selectedTermName.placeholder = event.currentTarget.innerHTML;
  1165 +
  1166 + //get data from pindata for this trem
  1167 +
  1168 + var pinDataForTerm = new jinqJs()
  1169 + .from($scope.aaPinData)
  1170 + .where("_TermId == " + $scope.searchItemId)
  1171 + .select();
  1172 +
  1173 + $scope.showAnnotation(pinDataForTerm, false, false, true);
  1174 + // $scope.HighlightBodyOnListManagerSelection(event.currentTarget.id);
  1175 +
  1176 + $scope.IsSearchVisible = false;
  1177 + // $rootScope.isNormalMode = false;
  1178 + }
  1179 +
  1180 +
1187 1181 }]);
1188 1182  
1189 1183 function showSelectedSystemPins(event) {
... ... @@ -1210,10 +1204,26 @@ function showAllPins(event) {
1210 1204 });
1211 1205 }
1212 1206  
1213   -function OnSearchAA(event) {
  1207 +function onSearchAA(event) {
1214 1208 console.log('AA search is called')
1215 1209 var scope = angular.element(document.getElementById("aaDetailPageDiv")).scope();
1216 1210 scope.$apply(function () {
1217 1211 scope.showItemsForSearch();
1218 1212 });
1219   -}
1220 1213 \ No newline at end of file
  1214 +}
  1215 +
  1216 +function hideSearchList(event) {
  1217 + console.log('AA hide search is called')
  1218 + var scope = angular.element(document.getElementById("aaDetailPageDiv")).scope();
  1219 + scope.$apply(function () {
  1220 + scope.HideSearchList();
  1221 + });
  1222 +}
  1223 +
  1224 +function onSearchItemSelection(event) {
  1225 + console.log('AA hide search is called')
  1226 + var scope = angular.element(document.getElementById("aaDetailPageDiv")).scope();
  1227 + scope.$apply(function () {
  1228 + scope.highlightPinBasedOnSerachItem(event);
  1229 + });
  1230 +}
... ...
400-SOURCECODE/AIAHTML5.Web/app/views/aa/atlas-anatomy-detail.html
... ... @@ -76,7 +76,7 @@
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="OnSearchAA()" ondblclick="OnSearchAA()" ng-model="searchFilter" placeholder=" search...">
  79 + <input type="text" class="form-control input-sm pull-left" id="selectedTermName" onclick="onSearchAA()" ondblclick="onSearchAA()" onblur="hideSearchList()" ng-model="searchFilter" placeholder=" search...">
80 80  
81 81 <div id="backdrop" ng-show="IsSearchVisible">
82 82 <div id="searchListDivAA" class="col-sm-12 col-xs-12 col-md-12 col-lg-12 pull-left">
... ...