From d57217d03cce10cd210e45f544f710f135bb7a23 Mon Sep 17 00:00:00 2001 From: nikita Date: Wed, 14 Jun 2017 18:30:25 +0530 Subject: [PATCH] added search code --- 400-SOURCECODE/AIAHTML5.Web/app/controllers/TileViewListController.js | 72 ++++++++++++++++++++++++++++++++++++++++++------------------------------ 400-SOURCECODE/AIAHTML5.Web/app/views/aa/atlas-anatomy-detail.html | 9 ++++++++- 2 files changed, 50 insertions(+), 31 deletions(-) diff --git a/400-SOURCECODE/AIAHTML5.Web/app/controllers/TileViewListController.js b/400-SOURCECODE/AIAHTML5.Web/app/controllers/TileViewListController.js index 773053f..2d9f841 100644 --- a/400-SOURCECODE/AIAHTML5.Web/app/controllers/TileViewListController.js +++ b/400-SOURCECODE/AIAHTML5.Web/app/controllers/TileViewListController.js @@ -1051,36 +1051,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo } } - //var Annotation; - //$scope.ActualTermNo = actualTermNo; - //for (var j = 0; j <= $rootScope.vocabTermDataArray.length - 1; j++) { - - // if ($rootScope.vocabTermDataArray[j].language == language) { - - // if ($rootScope.vocabTermDataArray[j].VocabTermData != null || $rootScope.vocabTermDataArray[j].VocabTermData != undefined) { - // $scope.matchedActualTermData = new jinqJs() - // .from($rootScope.vocabTermDataArray[j].VocabTermData.VocabTerms.Term) - // .where('_ActualTermNumber == ' + actualTermNo) - // .select(); - - // if ($scope.matchedActualTermData != null || $scope.matchedActualTermData != undefined) { - // for (var z = 0; z <= $scope.matchedActualTermData.length; z++) { - // //send actual term no to get the term text. - // Annotation = $scope.matchedActualTermData[0]._TermText; - // // alert("Annotation : " + Annotation); - // break; - // }; - // } - // return Annotation; - // } - - // else { - // return null; - // } - - // } - //} - + @@ -1146,6 +1117,39 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo }).drawLayers(); }) } + + + $scope.showItemsForSearch = function () { + console.log('ShowSearch is called'); + //this check is for log only because we are writing length so need to check if its not null or undefined + + + $timeout(function () { + if (($scope.AAPinTermData != null || $scope.AAPinTermData != undefined) && ($scope.AAPinTermData.length > 0)) { + + $scope.IsSearchVisible = true; + // document.getElementById("termlistfilter").style.display = "block"; + } + else { + $rootScope.loadSearchData(); + if ($scope.AAPinTermData.length > 0) { + $scope.ShowSearch(); + } + } + + if ($rootScope.isSearchInputClicked == true) { + $rootScope.isSearchInputClicked = false; + $rootScope.searchListArray = []; + $("#backdrop > #searchListDiv > #termlistfilter > li").each(function (key, value) { + $rootScope.searchListArray.push({ "name": $(this).find("a").html(), "id": $(this).find("a").attr("id") }); + }); + + } + + }, 500); + + } + }]); function showSelectedSystemPins(event) { @@ -1170,4 +1174,12 @@ function showAllPins(event) { scope.$apply(function () { scope.showAllPinsAfterHide(event); }); +} + +function onSearch(event) { + + var scope = angular.element(document.getElementById("aaDetailPageDiv")).scope(); + scope.$apply(function () { + scope.showSItemsForearch(); + }); } \ No newline at end of file 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 a79c393..12a3869 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 @@ -66,7 +66,7 @@