Commit 1e25a2bde06a4a3596491d11b06747e8637e173a

Authored by Nikita Kulshreshtha
1 parent e1bbbbb5

now, on search input if user search someting by writing/deleting, only 10 relate…

…d terms will be populated.
We have given a search button near search input, when user will click on this button all the related terms will be populated in a pop up and from there user can select any term.
400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js
... ... @@ -9000,47 +9000,47 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l
9000 9000 }
9001 9001  
9002 9002 $scope.jumpToTerm = function (event) {
9003   -
9004   - $rootScope.searchSelectedText = $('#' + event.currentTarget.id).text();
9005   - $('#termList option[selected="selected"]').prop("selected", false);
9006   - $('#termList option[value="' + $rootScope.searchSelectedText + '"]').prop("selected", true);
9007   - $("#termList").find("option").css({ "background-color": "#ffffff", "color": "#000000" });
9008   - $('#termList option[value="' + $rootScope.searchSelectedText + '"]').css({ "background-color": "#3399FF", "color": "#ffffff" });
  9003 + if ($rootScope.searchSelectedText != $('#' + event.currentTarget.id).text()) {
  9004 + $rootScope.searchSelectedText = $('#' + event.currentTarget.id).text();
  9005 + $('#termList option[selected="selected"]').prop("selected", false);
  9006 + $('#termList option[value="' + $rootScope.searchSelectedText + '"]').prop("selected", true);
  9007 + $("#termList").find("option").css({ "background-color": "#ffffff", "color": "#000000" });
  9008 + $('#termList option[value="' + $rootScope.searchSelectedText + '"]').css({ "background-color": "#3399FF", "color": "#ffffff" });
9009 9009  
9010 9010  
9011   - $rootScope.isLoading = true;
  9011 + $rootScope.isLoading = true;
9012 9012  
9013   - $('#spinner').css('visibility', 'visible');
9014   - //1.
9015   - $scope.searchFilter = event.currentTarget.innerHTML;
  9013 + $('#spinner').css('visibility', 'visible');
  9014 + //1.
  9015 + $scope.searchFilter = event.currentTarget.innerHTML;
9016 9016  
9017   - //2.
9018   - $scope.HighlightBodyOnListManagerSelection(event.currentTarget.id);
  9017 + //2.
  9018 + $scope.HighlightBodyOnListManagerSelection(event.currentTarget.id);
9019 9019  
9020   - $scope.IsSearchVisible = false;
9021   - $rootScope.isNormalMode = false;
  9020 + $scope.IsSearchVisible = false;
  9021 + $rootScope.isNormalMode = false;
9022 9022  
9023   - //Highlight only Highlight button
  9023 + //Highlight only Highlight button
9024 9024  
9025   - $("#btnHighLight").addClass("btn-primary");
9026   - $("#btnHighLight").removeClass("btn-black");
  9025 + $("#btnHighLight").addClass("btn-primary");
  9026 + $("#btnHighLight").removeClass("btn-black");
9027 9027  
9028   - if (!$("#btnNormalMode").hasClass("btn-black")) {
9029   - $("#btnNormalMode").addClass("btn-black");
9030   - }
  9028 + if (!$("#btnNormalMode").hasClass("btn-black")) {
  9029 + $("#btnNormalMode").addClass("btn-black");
  9030 + }
9031 9031  
9032   - if (!$("#btnExtract").hasClass("btn-black")) {
9033   - $("#btnExtract").addClass("btn-black");
9034   - }
  9032 + if (!$("#btnExtract").hasClass("btn-black")) {
  9033 + $("#btnExtract").addClass("btn-black");
  9034 + }
9035 9035  
9036   - if ($("#btnExtract").hasClass("btn-primary")) {
9037   - $("#btnExtract").removeClass("btn-primary");
9038   - }
  9036 + if ($("#btnExtract").hasClass("btn-primary")) {
  9037 + $("#btnExtract").removeClass("btn-primary");
  9038 + }
9039 9039  
9040   - if ($("#btnNormalMode").hasClass("btn-primary")) {
9041   - $("#btnNormalMode").removeClass("btn-primary");
  9040 + if ($("#btnNormalMode").hasClass("btn-primary")) {
  9041 + $("#btnNormalMode").removeClass("btn-primary");
  9042 + }
9042 9043 }
9043   -
9044 9044 }
9045 9045  
9046 9046 //Function to set the vertical and horizontal scroll position of CanvasDiv as per the Navigator
... ... @@ -9801,9 +9801,61 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l
9801 9801  
9802 9802 $scope.resetSearchListView = function () {
9803 9803  
9804   - $scope.ShowSearch();
  9804 + // $scope.ShowSearch();
  9805 + $scope.showFilteredTerms()
  9806 + }
  9807 + $scope.showFilteredTerms = function () {
  9808 +
  9809 + if ($('#searchListDiv').html() != "") {
  9810 + $('#searchListDiv').empty();
  9811 + }
  9812 + $rootScope.a = $scope.primaryLexiconInd;
  9813 + var $e2 = $('<ul id="termlistfilter" class="form-control dropdown-menu ng-scope" style="height:90px;width:100%;overflow-y:scroll;position:absolute;display:block;z-index:60001;"><li class="ng-scope" ng-repeat="item in vocabTermDataArray[a].vocabTermTxt| filter:{ _TermText: searchFilter}| limitTo : 10">' +
  9814 + '<a id="{{item._ActualTermNumber}}" href="" onclick="selectTerm(event)">{{item._TermText}}</a>' +
  9815 + ' </li></ul>').appendTo('#searchListDiv')
  9816 + $compile($e2)($scope);
  9817 + document.getElementById("termlistfilter").style.display = "block";
  9818 + $timeout(function () {
  9819 + $("#backdrop > #searchListDiv > #termlistfilter > li").each(function (key, value) {
  9820 + if ($(this).find("a").html() == document.getElementById("typedTermName").value) {
  9821 + $("#termlistfilter li a").css({ "background-color": "#ffffff", "color": "#000000" });
  9822 + $(this).find("a").css({ "background-color": "#3399FF", "color": "#ffffff" });
  9823 + }
  9824 + });
  9825 + }, 100);
  9826 + };
  9827 +
  9828 + $scope.ApplySearch = function () {
  9829 + $rootScope.isLoading = false;
  9830 + $('#spinner').css('visibility', 'hidden');
  9831 +
  9832 + $('#searchedTermListPopUp').css('display', 'block');
  9833 + $("#searchedTermListPopUp").css("visibility", "visible");
  9834 +
  9835 + $('#searchedTermListPopUp').draggable();
  9836 +
  9837 + $scope.FillSearchList();
9805 9838 }
  9839 + $scope.FillSearchList = function () {
  9840 +
  9841 + $('#searchTermListUl').empty();
9806 9842  
  9843 + $rootScope.a = $scope.primaryLexiconInd;
  9844 + $scope.sFilter = $("#typedTermName").val();
  9845 + var $e2 = $('<li class="ng-scope" ng-repeat="item in vocabTermDataArray[a].vocabTermTxt| filter:{ _TermText: sFilter}">' +
  9846 + '<a id="{{item._ActualTermNumber}}" href="" onclick="selectTerm(event)">{{item._TermText}}</a>' +
  9847 + ' </li>').appendTo('#searchTermListUl')
  9848 + $compile($e2)($scope);
  9849 +
  9850 + $rootScope.isLoading = false;
  9851 + $('#spinner').css('visibility', 'hidden');
  9852 +
  9853 + }
  9854 + $scope.closeSerachTermListPopUp = function () {
  9855 + $('#searchedTermListPopUp').css('display', 'none');
  9856 + $("#searchedTermListPopUp").css("visibility", "hidden");
  9857 +
  9858 + }
9807 9859 }])
9808 9860  
9809 9861 function OnGenderChange(event) {
... ...