diff --git a/400-SOURCECODE/AIAHTML5.Web/app/controllers/TileViewListController.js b/400-SOURCECODE/AIAHTML5.Web/app/controllers/TileViewListController.js index 41d33a8..9c97b55 100644 --- a/400-SOURCECODE/AIAHTML5.Web/app/controllers/TileViewListController.js +++ b/400-SOURCECODE/AIAHTML5.Web/app/controllers/TileViewListController.js @@ -489,7 +489,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo }) //show annotation on first pin of the sysyem - $scope.showAnnotation($scope.selectedSystemPinData, false, false); + $scope.showAnnotation($scope.selectedSystemPinData, false, false, false); } } } @@ -503,7 +503,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo } } - $scope.showAnnotation = function (selectedPinData, isCtrlPressed, isPinClicked) { + $scope.showAnnotation = function (selectedPinData, isCtrlPressed, isPinClicked, isItemSearched) { $scope.selectedPin = []; var isSameTermWithMultiPin = false; @@ -520,30 +520,13 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo $scope.MultiLanguageAnnationArray = []; - // get termText info - // var promise = ModuleService.getTermTextDataForPin($scope.moduleName) - //.then( - // function (response) { - - // $scope.TermInfo = response.data.Terms.Term; - - // if ($scope.TermInfo != null && $scope.TermInfo.length > 0) { - - // var termTextdata = new jinqJs() - // .from($scope.TermInfo) - // .where("__ActualTermNumber == " + pinTermNumber) - // .select(); - - // var termText = termTextdata[0].__TermText; - // $scope.MultiLanguageAnnationArray = []; - // $scope.MultiLanguageAnnationArray.push(termText); $scope.GetAnnotationBasedOnActualTermNo(pinTermNumber); if (isCtrlPressed) { } else { - if (isPinClicked) { + if (isPinClicked || isItemSearched) { var existingSpeechBubble = $("div[id*='speechBubble']"); for (var i = 0; i < existingSpeechBubble.length; i++) { existingSpeechBubble[i].parentNode.removeChild(existingSpeechBubble[i]); @@ -777,7 +760,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo speechBubbleDims.push({ currentX: x, currentY: y }); document.getElementById('speechBubbleLine' + PinId + '').style.display = 'block'; document.getElementById('speechBubbleLine' + PinId + '').style.left = ((speechBubbleDims[0].currentX - 45)) + 'px'; - document.getElementById('speechBubbleLine' + PinId + '').style.top = ((speechBubbleDims[0].currentY) - 40) + 'px'; + document.getElementById('speechBubbleLine' + PinId + '').style.top = ((speechBubbleDims[0].currentY) - 20) + 'px'; document.getElementById('speechBubble' + PinId + '').style.display = 'block'; document.getElementById('speechBubble' + PinId + '').style.left = (speechBubbleDims[0].currentX - 70) + 'px'; 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 .where("_PinId == " + pinID) .select(); if (clickedPin.event.ctrlKey == true) { - $scope.showAnnotation(selectedPinData, true, true); + $scope.showAnnotation(selectedPinData, true, true, false); } else { - $scope.showAnnotation(selectedPinData, false, true); + $scope.showAnnotation(selectedPinData, false, true, false); } @@ -974,18 +957,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo $rootScope.loadSearchData = function () { - //var promise = ModuleService.getTermTextDataForPin($scope.moduleName) - // .then( - // function (response) { - - // $scope.TermInfo = response.data.Terms.Term; - - // }, - // function (error) { - // // handle errors here - // console.log(' error: ' + error.statusText); - // } - // ) + var imageId = $rootScope.imageId; var promise = ModuleService.getTermTextDataForAAImage(imageId) .then( @@ -1006,7 +978,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo $scope.pinTermData.push({ "LanguageId": $scope.matchedLanguageTermData[i]._LanguageId, "TermNumber": $scope.matchedLanguageTermData[i]._TermNumber, "TermTxt": $scope.matchedLanguageTermData[i]._TermText }); } - $scope.$watch('$$scope.pinTermData', function (newValue, oldValue, scope) { + $scope.$watch('$scope.pinTermData', function (newValue, oldValue, scope) { if ($('#termlistfilter').html() != "") $('#termlistfilter').empty() if ($scope.pinTermData.length > 0) { @@ -1014,17 +986,11 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo console.log('pinTermData= ' + $scope.pinTermData.length); for (var j = 0; j < $scope.pinTermData.length; j++) { - var $el = $('
  • '+$scope.pinTermData[j].TermTxt+'
  • ').appendTo('#termlistfilter') + var $el = $('
  • ' + $scope.pinTermData[j].TermTxt + '
  • ').appendTo('#termlistfilter') $compile($el)($scope); } - - //var $e2 = $('').appendTo('#searchListDivAA') - //$compile($e2)($scope); - }, 500); } }) @@ -1064,24 +1030,13 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo $scope.MultiLanguageAnnationArray.push(termText); - ////1. - //var actualTermNo = 0; - //for (var z = 0; z < $scope.matchedTermNoData.length; z++) { - // //send actual term no to get the term text. - // actualTermNo = $scope.matchedTermNoData[0]._ActualTermNumber; - // annotationText = $scope.GetAnnotationBasedOnActualTermNo(actualTermNo, languageArray[j].language); - // annotation.push(annotationText); - // $rootScope.annotationText.push(annotationText); - // $rootScope.actualTermNumber = actualTermNo; - // break; - }; - - //2. + + }; + + } - else { - // send term no to vocab json data to get the text - } + } } @@ -1184,6 +1139,45 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo } + + $scope.HideSearchList = function () { + + $timeout(function () { + + $("#termlistfilter").css("display", "none"); + + + }, 1000); + + } + + $scope.highlightPinBasedOnSerachItem = function (event) { + debugger; + $scope.searchItemId = event.currentTarget.id; + $scope.searchItemText = event.currentTarget.innerHTML; + $('#termList option[selected="selected"]').prop("selected", false); + $('#termList option[value="' + $rootScope.searchSelectedText + '"]').prop("selected", true); + $("#termList").find("option").css({ "background-color": "#ffffff", "color": "#000000" }); + $('#termList option[value="' + $rootScope.searchSelectedText + '"]').css({ "background-color": "#3399FF", "color": "#ffffff" }); + + $scope.searchFilter = event.currentTarget.innerHTML; + selectedTermName.placeholder = event.currentTarget.innerHTML; + + //get data from pindata for this trem + + var pinDataForTerm = new jinqJs() + .from($scope.aaPinData) + .where("_TermId == " + $scope.searchItemId) + .select(); + + $scope.showAnnotation(pinDataForTerm, false, false, true); + // $scope.HighlightBodyOnListManagerSelection(event.currentTarget.id); + + $scope.IsSearchVisible = false; + // $rootScope.isNormalMode = false; + } + + }]); function showSelectedSystemPins(event) { @@ -1210,10 +1204,26 @@ function showAllPins(event) { }); } -function OnSearchAA(event) { +function onSearchAA(event) { console.log('AA search is called') var scope = angular.element(document.getElementById("aaDetailPageDiv")).scope(); scope.$apply(function () { scope.showItemsForSearch(); }); -} \ No newline at end of file +} + +function hideSearchList(event) { + console.log('AA hide search is called') + var scope = angular.element(document.getElementById("aaDetailPageDiv")).scope(); + scope.$apply(function () { + scope.HideSearchList(); + }); +} + +function onSearchItemSelection(event) { + console.log('AA hide search is called') + var scope = angular.element(document.getElementById("aaDetailPageDiv")).scope(); + scope.$apply(function () { + scope.highlightPinBasedOnSerachItem(event); + }); +} diff --git a/400-SOURCECODE/AIAHTML5.Web/app/views/aa/atlas-anatomy-detail.html b/400-SOURCECODE/AIAHTML5.Web/app/views/aa/atlas-anatomy-detail.html index 92495bf..7b31e87 100644 --- a/400-SOURCECODE/AIAHTML5.Web/app/views/aa/atlas-anatomy-detail.html +++ b/400-SOURCECODE/AIAHTML5.Web/app/views/aa/atlas-anatomy-detail.html @@ -76,7 +76,7 @@ --> - +