Merged
Merge Request #962 · created by Pankaj Tiwary


Aia bug 26464


From AIA_BUG_26464 into Develop

Merged by Pankaj Tiwary

1 participants


400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js
... ... @@ -4613,11 +4613,21 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$filter","$
4613 4613 $scope.TransparencyBoxEndY = TransparencyBoxEndY;
4614 4614  
4615 4615 if ($scope.TransparencyBoxStartX == $scope.TransparencyEndX && $scope.TransparencyBoxStartY == $scope.TransparencyBoxEndY) {
4616   - // $('#transparencyScale').css('visibility', 'hidden');
  4616 +
  4617 + //#Bug 26464
  4618 + $timeout(function () {
  4619 + angular.element(document.activeElement).blur();
  4620 + });
  4621 +
4617 4622 } else {
4618 4623  
4619 4624 if (previewRectangleWidth == 0 && previewRectangleHeight == 0) {
4620 4625  
  4626 + //#Bug 26464
  4627 + $timeout(function () {
  4628 + angular.element(document.activeElement).blur();
  4629 + });
  4630 +
4621 4631 }
4622 4632 else {
4623 4633  
... ... @@ -8920,7 +8930,6 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$filter","$
8920 8930 if ($('#searchListDiv').html() != "")
8921 8931 $('#searchListDiv').empty();
8922 8932 //Delay compile of ul li so that the remove of li is completed.
8923   - $timeout(function () {
8924 8933  
8925 8934 $scope.isSearchDataLoaded = true;
8926 8935  
... ... @@ -8944,13 +8953,13 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$filter","$
8944 8953 }
8945 8954 }
8946 8955  
8947   - }, 500);
  8956 +
8948 8957 $scope.IsSearchVisible = true;
8949 8958 console.log("primary language: " + $rootScope.vocabTermDataArray[primaryLexiconIndx].language);
8950 8959  
8951 8960  
8952 8961 $rootScope.a = primaryLexiconIndx;
8953   - 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}">' +
  8962 + 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} | limitTo : 10">' +
8954 8963 '<a id="{{item._ActualTermNumber}}" href="" onclick="selectTerm(event)">{{item._TermText}}</a>' +
8955 8964 ' </li></ul>').appendTo('#searchListDiv')
8956 8965 $compile($e2)($scope);
... ... @@ -8958,27 +8967,22 @@ AIA.controller(&quot;DAController&quot;, [&quot;$scope&quot;, &quot;$rootScope&quot;, &quot;$compile&quot;, &quot;$filter&quot;,&quot;$
8958 8967 console.log('termlistfilter is created and complied');
8959 8968  
8960 8969 document.getElementById("termlistfilter").style.display = "block";
8961   - $timeout(function () {
  8970 +
8962 8971 $("#backdrop > #searchListDiv > #termlistfilter > li").each(function (key, value) {
8963 8972 if ($(this).find("a").html() == document.getElementById("typedTermName").value) {
8964 8973 $("#termlistfilter li a").css({ "background-color": "#ffffff", "color": "#000000" });
8965 8974 $(this).find("a").css({ "background-color": "#3399FF", "color": "#ffffff" });
8966 8975 }
8967 8976 });
8968   - }, 100);
8969   - $timeout(function () {
8970 8977 $rootScope.searchListArray = [];
8971 8978 $("#backdrop > #searchListDiv > #termlistfilter > li").each(function (key, value) {
8972 8979 $rootScope.searchListArray.push({ "name": $(this).find("a").html(), "id": $(this).find("a").attr("id") });
8973 8980 });
8974   - }, 100);
  8981 +
8975 8982  
8976 8983 }
8977 8984 else {
8978 8985 $rootScope.loadSearchData();
8979   - //if ($rootScope.vocabTermDataArray[primaryLexiconIndx].vocabTermTxt.length > 0) {
8980   - // $scope.ShowSearch();
8981   - //}
8982 8986 }
8983 8987 }, 500);
8984 8988  
... ... @@ -9809,13 +9813,15 @@ AIA.controller(&quot;DAController&quot;, [&quot;$scope&quot;, &quot;$rootScope&quot;, &quot;$compile&quot;, &quot;$filter&quot;,&quot;$
9809 9813 if ($('#searchListDiv').html() != "") {
9810 9814 $('#searchListDiv').empty();
9811 9815 }
  9816 + //Bug 39757
  9817 + $timeout(function () {
9812 9818 $rootScope.a = $scope.primaryLexiconInd;
9813 9819 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">' +
9814 9820 '<a id="{{item._ActualTermNumber}}" href="" onclick="selectTerm(event)">{{item._TermText}}</a>' +
9815 9821 ' </li></ul>').appendTo('#searchListDiv')
9816 9822 $compile($e2)($scope);
9817 9823 document.getElementById("termlistfilter").style.display = "block";
9818   - $timeout(function () {
  9824 +
9819 9825 $("#backdrop > #searchListDiv > #termlistfilter > li").each(function (key, value) {
9820 9826 if ($(this).find("a").html() == document.getElementById("typedTermName").value) {
9821 9827 $("#termlistfilter li a").css({ "background-color": "#ffffff", "color": "#000000" });
... ... @@ -9909,7 +9915,8 @@ function enableShowHideStructureBox() {
9909 9915 function OnSearch() {
9910 9916 console.log('Show Search is called outside ');
9911 9917 var scope = angular.element(document.getElementById("daView")).scope();
9912   - scope.$apply(function () {
  9918 + //Bug 39757
  9919 + scope.$evalAsync(function () {
9913 9920 scope.ShowSearch();
9914 9921 });
9915 9922 }
... ...
400-SOURCECODE/AIAHTML5.Web/app/filters/AIAFilter.js
... ... @@ -2,15 +2,19 @@
2 2 return function (items, letter) {
3 3  
4 4 var filtered = [];
5   - var letterMatch = new RegExp("^" + letter._TermText, 'i');
6   - for (var i = 0; i < items.length; i++) {
7   - var item = items[i];
8   - //if (letterMatch.test(item._TermText.substring(0, 1))) {
9   - if (letterMatch.test(item._TermText)) {
  5 + var letterMatch = new RegExp("^" + letter._TermText, 'i');
  6 + for (var i = 0; i < items.length; i++) {
  7 + var item = items[i];
  8 + //Bug 39757
  9 + if (letterMatch.test(item._TermText)) {
10 10  
11   - filtered.push(item);
  11 + filtered.push(item);
  12 + }
  13 + //Bug 39757
  14 + if (filtered.length > 10) {
  15 + break;
  16 + }
12 17 }
13   - }
14 18 return filtered;
15 19 };
16 20 });
17 21 \ No newline at end of file
... ...