Commit c85e981006218e2fa99284b3c0d138454e7f2343

Authored by Shashi Bhushan Kumar
1 parent b3224685

for bug 39757

400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js
@@ -8958,16 +8958,18 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$filter","$ @@ -8958,16 +8958,18 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$filter","$
8958 $scope.IsSearchVisible = true; 8958 $scope.IsSearchVisible = true;
8959 console.log("primary language: " + $rootScope.vocabTermDataArray[primaryLexiconIndx].language); 8959 console.log("primary language: " + $rootScope.vocabTermDataArray[primaryLexiconIndx].language);
8960 8960
8961 -  
8962 - $rootScope.a = primaryLexiconIndx;  
8963 - var $e2 = $('<ul id="termlistfilter" class="form-control dropdown-menu" style="height:130px;width:100%;overflow-y:scroll;position:absolute;display:none;z-index:60001;"><li ng-repeat="item in vocabTermDataArray[a].vocabTermTxt| filter:{ _TermText: searchFilter}">' +  
8964 - '<a id="{{item._ActualTermNumber}}" href="" onclick="selectTerm(event)">{{item._TermText}}</a>' +  
8965 - ' </li></ul>').appendTo('#searchListDiv')  
8966 - $compile($e2)($scope);  
8967 - 8961 + $timeout(function () {
  8962 + $rootScope.a = primaryLexiconIndx;
  8963 + var $e2 = $('<ul id="termlistfilter" class="form-control dropdown-menu" style="height:130px;width:100%;overflow-y:scroll;position:absolute;display:none;z-index:60001;"><li ng-repeat="item in vocabTermDataArray[a].vocabTermTxt| filter:{ _TermText: searchFilter}">' +
  8964 + '<a id="{{item._ActualTermNumber}}" href="" onclick="selectTerm(event)">{{item._TermText}}</a>' +
  8965 + ' </li></ul>').appendTo('#searchListDiv');
  8966 + $compile($e2)($scope);
  8967 + document.getElementById("termlistfilter").style.display = "block";
  8968 + console.log('termlistfilter is complied');
  8969 + }, 150);//Bug#39757
8968 console.log('termlistfilter is created and complied'); 8970 console.log('termlistfilter is created and complied');
8969 8971
8970 - document.getElementById("termlistfilter").style.display = "block"; 8972 +
8971 $timeout(function () { 8973 $timeout(function () {
8972 $("#backdrop > #searchListDiv > #termlistfilter > li").each(function (key, value) { 8974 $("#backdrop > #searchListDiv > #termlistfilter > li").each(function (key, value) {
8973 if ($(this).find("a").html() == document.getElementById("typedTermName").value) { 8975 if ($(this).find("a").html() == document.getElementById("typedTermName").value) {
@@ -9820,11 +9822,14 @@ AIA.controller(&quot;DAController&quot;, [&quot;$scope&quot;, &quot;$rootScope&quot;, &quot;$compile&quot;, &quot;$filter&quot;,&quot;$ @@ -9820,11 +9822,14 @@ AIA.controller(&quot;DAController&quot;, [&quot;$scope&quot;, &quot;$rootScope&quot;, &quot;$compile&quot;, &quot;$filter&quot;,&quot;$
9820 $('#searchListDiv').empty(); 9822 $('#searchListDiv').empty();
9821 } 9823 }
9822 $rootScope.a = $scope.primaryLexiconInd; 9824 $rootScope.a = $scope.primaryLexiconInd;
  9825 + $timeout(function () {
9823 var $e2 = $('<ul id="termlistfilter" class="form-control dropdown-menu ng-scope" style="height:132px;width:100%;overflow-y:scroll;position:absolute;display:block;z-index:60001;"><li class="ng-scope" ng-repeat="item in vocabTermDataArray[a].vocabTermTxt| startsWithLetter:{ _TermText: searchFilter}| limitTo : 10">' + 9826 var $e2 = $('<ul id="termlistfilter" class="form-control dropdown-menu ng-scope" style="height:132px;width:100%;overflow-y:scroll;position:absolute;display:block;z-index:60001;"><li class="ng-scope" ng-repeat="item in vocabTermDataArray[a].vocabTermTxt| startsWithLetter:{ _TermText: searchFilter}| limitTo : 10">' +
9824 '<a id="{{item._ActualTermNumber}}" href="" onclick="selectTerm(event)">{{item._TermText}}</a>' + 9827 '<a id="{{item._ActualTermNumber}}" href="" onclick="selectTerm(event)">{{item._TermText}}</a>' +
9825 ' </li></ul>').appendTo('#searchListDiv') 9828 ' </li></ul>').appendTo('#searchListDiv')
9826 - $compile($e2)($scope);  
9827 - document.getElementById("termlistfilter").style.display = "block"; 9829 + $compile($e2)($scope);
  9830 + console.log('showFilteredTerms is compiled');
  9831 + document.getElementById("termlistfilter").style.display = "block";
  9832 + }, 50);//Bug#39757
9828 $timeout(function () { 9833 $timeout(function () {
9829 $("#backdrop > #searchListDiv > #termlistfilter > li").each(function (key, value) { 9834 $("#backdrop > #searchListDiv > #termlistfilter > li").each(function (key, value) {
9830 if ($(this).find("a").html() == document.getElementById("typedTermName").value) { 9835 if ($(this).find("a").html() == document.getElementById("typedTermName").value) {
@@ -9918,10 +9923,13 @@ function enableShowHideStructureBox() { @@ -9918,10 +9923,13 @@ function enableShowHideStructureBox() {
9918 9923
9919 function OnSearch() { 9924 function OnSearch() {
9920 console.log('Show Search is called outside '); 9925 console.log('Show Search is called outside ');
9921 - var scope = angular.element(document.getElementById("daView")).scope();  
9922 - scope.$apply(function () {  
9923 - scope.ShowSearch();  
9924 - }); 9926 + setTimeout(function () {
  9927 + var scope = angular.element(document.getElementById("daView")).scope();
  9928 + scope.$evalAsync(function () {
  9929 + scope.ShowSearch();
  9930 + });
  9931 + }, 10);//Bug#39757
  9932 +
9925 } 9933 }
9926 function selectTerm(event) { 9934 function selectTerm(event) {
9927 console.log('selectTerm is called outside '); 9935 console.log('selectTerm is called outside ');