From bb3714dd3e4bb4b35e66346a93b41efa23a2275f Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 14 Mar 2017 12:11:39 +0530 Subject: [PATCH] DA > Search List > Search List drop-down is not appear when type the body structure name in the search text field --- 400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js | 139 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-------------------------- 400-SOURCECODE/AIAHTML5.Web/app/views/da/da-view.html | 5 +++-- 2 files changed, 116 insertions(+), 28 deletions(-) diff --git a/400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js b/400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js index 3c479b4..d1f7519 100644 --- a/400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js +++ b/400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js @@ -563,7 +563,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo value: 0, slide: function (event, ui) { // $("#txtlayerNumber").val(100 - ui.value); // basic math operation.. - + // $("#txtlayerNumber").val($("#layerChangeSlider").slider("value")); }, stop: function (event, ui) { @@ -614,11 +614,13 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo } } } - }); + }); + + }) $scope.loadSearchDataForBodyView = function () { - + console.log('loadSearchDataForBodyView'); var currentBodyViewId = localStorage.getItem("currentBodyViewId"); @@ -684,11 +686,13 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo '{{item._TermText}}' + ' ').appendTo('#searchListDiv') $compile($e2)($scope); - + }, 500); - + }, true); + + } $scope.loadBodyViewData = function (currentVoid) { @@ -2761,9 +2765,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo // $rootScope.isListManagerSelected = false; $rootScope.CloseListManager(); - - - + $scope.isLayerChange = true; $rootScope.isLoading = true; $('#spinner').css('visibility', 'visible'); @@ -6921,6 +6923,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo $scope.female = "active"; } $rootScope.CloseAnnotationTool(); + $scope.searchFilter = ''; } //clsoe worker process @@ -7043,7 +7046,6 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo //Remove the search list and then Repopulate it on change of View $('#searchListDiv').empty() - if ($rootScope.openViews.length > 0) { $rootScope.openViews.splice($rootScope.openViews.length - 1); } @@ -7129,6 +7131,14 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo //2. $scope.loadNavigatorForSelectedBodyView($rootScope.voId); + //3. load corresponding navigator man + $scope.loadNavigatorForSelectedBodyView($rootScope.voId); + + //4. change the search terms as per the selected bodyview + $scope.loadSearchDataForBodyView(); + + //5.Change the popup title next to search + $scope.currentTitleFromJson = localStorage.getItem("currentViewTitle"); }; @@ -7206,7 +7216,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo } //13573 : DA > Annotations should not be display if we change the body view. $rootScope.CloseAnnotationTool(); - + $scope.searchFilter = ''; } //Reload DA controller event listener after setting change @@ -7623,22 +7633,22 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo if ($("#btnExtract").hasClass("btn-primary")) { $("#btnExtract").removeClass("btn-primary"); } - + if ($("#btnNormalMode").hasClass("btn-primary")) { $("#btnNormalMode").removeClass("btn-primary"); } } - + $rootScope.IsSearchInputClicked = true; $scope.ShowSearch = 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 if ($scope.VocabTermTxt != null || $scope.VocabTermTxt != undefined) - console.log('$scope.VocabTermTxt.length= ' + $scope.VocabTermTxt.length) + console.log('$scope.VocabTermTxt.length= ' + $scope.VocabTermTxt.length) $timeout(function () { - if (($scope.VocabTermTxt!=null|| $scope.VocabTermTxt!=undefined) && ($scope.VocabTermTxt.length > 0)) { + if (($scope.VocabTermTxt != null || $scope.VocabTermTxt != undefined) && ($scope.VocabTermTxt.length > 0)) { + $scope.IsSearchVisible = true; document.getElementById("termlistfilter").style.display = "block"; } @@ -7648,13 +7658,21 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo $scope.ShowSearch(); } } - }, 500); + + 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") }); + }); - //$scope.IsSearchVisible = true; + } + + }, 500); - //document.getElementById("termlistfilter").style.display = "block"; } + $scope.HideSearch = function () { if ($("#backdrop").is(":hover") || $("#termlistfilter").is(":hover") || $("#typedtermname").is(":focus")) { $scope.IsSearchVisible = true; @@ -7676,7 +7694,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo } $scope.jumpToTerm = function (event) { - // alert(event.currentTarget.value); + $rootScope.searchSelectedText = $('#'+ event.currentTarget.id).text(); $('#termList option[selected="selected"]').prop("selected", false); $('#termList option[value="' + $rootScope.searchSelectedText + '"]').prop("selected", true); @@ -8414,17 +8432,86 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo } $scope.resetSearchListView = function () { - + + $("#termlistfilter").css("display", "block"); //Remove the list and then Repopulate it on change of $scope.searchFilter - $('#searchListDiv').empty() + $('#searchListDiv').empty(); + $rootScope.ModifiedsearchListArray = []; // added the timeout to delay the compile of ul li + $scope.IsSearchVisible = true; + + for (var i = 0; i <= $rootScope.searchListArray.length - 1; i++) + { + var searchFieldVal = $("#typedtermname").val(); + if (searchFieldVal.length > 0) { + var flag = true; + for (var j = 0; j <= searchFieldVal.length - 1; j++) { + + if (searchFieldVal[j].toUpperCase() != $rootScope.searchListArray[i].name[j].toUpperCase()) { + flag = false; + break; + } + } + if (flag == true) { + $rootScope.ModifiedsearchListArray.push({ "name": $rootScope.searchListArray[i].name, "id": $rootScope.searchListArray[i].id}); + console.log($rootScope.ModifiedsearchListArray); + } + + } + } + + var termListFilterHtml = ''; + termListFilterHtml += ''; + $('#searchListDiv').append(termListFilterHtml); + + } + else + { + console.log($rootScope.searchListArray.length); + for (var i = 0; i <= $rootScope.searchListArray.length - 1; i++) { + + termListFilterHtml += '
  • ' + $rootScope.searchListArray[i].name + '
  • '; + } + termListFilterHtml += ''; + $('#searchListDiv').append(termListFilterHtml); + + } + + + //$timeout(function () { + + + // var $e2 = $('').appendTo('#searchListDiv'); + + + // //var $e2 = $('').appendTo('#searchListDiv'); + + // $compile($e2)($scope); + + //}, 500); + + + } + + $rootScope.blurSearch = function () { + $timeout(function () { - var $e2 = $('').appendTo('#searchListDiv') - $compile($e2)($scope); - }, 500); + $("#termlistfilter").css("display", "none"); + + + }, 1000); } diff --git a/400-SOURCECODE/AIAHTML5.Web/app/views/da/da-view.html b/400-SOURCECODE/AIAHTML5.Web/app/views/da/da-view.html index 7967c1f..770bef2 100644 --- a/400-SOURCECODE/AIAHTML5.Web/app/views/da/da-view.html +++ b/400-SOURCECODE/AIAHTML5.Web/app/views/da/da-view.html @@ -130,6 +130,7 @@ left: 0; right: 0; } +
    @@ -268,14 +269,14 @@
    - +
    - +
    -- libgit2 0.21.4