Commit 1fa84b11e8fd5b582538c6376c4aa5d824dc6132
Merge branch 'AIA_BUG_26464' into 'Develop'
Aia bug 26464 See merge request !962
Showing
2 changed files
with
31 additions
and
20 deletions
400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js
@@ -4617,11 +4617,21 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$filter","$ | @@ -4617,11 +4617,21 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$filter","$ | ||
4617 | $scope.TransparencyBoxEndY = TransparencyBoxEndY; | 4617 | $scope.TransparencyBoxEndY = TransparencyBoxEndY; |
4618 | 4618 | ||
4619 | if ($scope.TransparencyBoxStartX == $scope.TransparencyEndX && $scope.TransparencyBoxStartY == $scope.TransparencyBoxEndY) { | 4619 | if ($scope.TransparencyBoxStartX == $scope.TransparencyEndX && $scope.TransparencyBoxStartY == $scope.TransparencyBoxEndY) { |
4620 | - // $('#transparencyScale').css('visibility', 'hidden'); | 4620 | + |
4621 | + //#Bug 26464 | ||
4622 | + $timeout(function () { | ||
4623 | + angular.element(document.activeElement).blur(); | ||
4624 | + }); | ||
4625 | + | ||
4621 | } else { | 4626 | } else { |
4622 | 4627 | ||
4623 | if (previewRectangleWidth == 0 && previewRectangleHeight == 0) { | 4628 | if (previewRectangleWidth == 0 && previewRectangleHeight == 0) { |
4624 | 4629 | ||
4630 | + //#Bug 26464 | ||
4631 | + $timeout(function () { | ||
4632 | + angular.element(document.activeElement).blur(); | ||
4633 | + }); | ||
4634 | + | ||
4625 | } | 4635 | } |
4626 | else { | 4636 | else { |
4627 | 4637 | ||
@@ -8924,7 +8934,6 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$filter","$ | @@ -8924,7 +8934,6 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$filter","$ | ||
8924 | if ($('#searchListDiv').html() != "") | 8934 | if ($('#searchListDiv').html() != "") |
8925 | $('#searchListDiv').empty(); | 8935 | $('#searchListDiv').empty(); |
8926 | //Delay compile of ul li so that the remove of li is completed. | 8936 | //Delay compile of ul li so that the remove of li is completed. |
8927 | - $timeout(function () { | ||
8928 | 8937 | ||
8929 | $scope.isSearchDataLoaded = true; | 8938 | $scope.isSearchDataLoaded = true; |
8930 | 8939 | ||
@@ -8948,13 +8957,13 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$filter","$ | @@ -8948,13 +8957,13 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$filter","$ | ||
8948 | } | 8957 | } |
8949 | } | 8958 | } |
8950 | 8959 | ||
8951 | - }, 500); | 8960 | + |
8952 | $scope.IsSearchVisible = true; | 8961 | $scope.IsSearchVisible = true; |
8953 | console.log("primary language: " + $rootScope.vocabTermDataArray[primaryLexiconIndx].language); | 8962 | console.log("primary language: " + $rootScope.vocabTermDataArray[primaryLexiconIndx].language); |
8954 | 8963 | ||
8955 | 8964 | ||
8956 | $rootScope.a = primaryLexiconIndx; | 8965 | $rootScope.a = primaryLexiconIndx; |
8957 | - 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}">' + | 8966 | + 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">' + |
8958 | '<a id="{{item._ActualTermNumber}}" href="" onclick="selectTerm(event)">{{item._TermText}}</a>' + | 8967 | '<a id="{{item._ActualTermNumber}}" href="" onclick="selectTerm(event)">{{item._TermText}}</a>' + |
8959 | ' </li></ul>').appendTo('#searchListDiv') | 8968 | ' </li></ul>').appendTo('#searchListDiv') |
8960 | $compile($e2)($scope); | 8969 | $compile($e2)($scope); |
@@ -8962,27 +8971,22 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$filter","$ | @@ -8962,27 +8971,22 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$filter","$ | ||
8962 | console.log('termlistfilter is created and complied'); | 8971 | console.log('termlistfilter is created and complied'); |
8963 | 8972 | ||
8964 | document.getElementById("termlistfilter").style.display = "block"; | 8973 | document.getElementById("termlistfilter").style.display = "block"; |
8965 | - $timeout(function () { | 8974 | + |
8966 | $("#backdrop > #searchListDiv > #termlistfilter > li").each(function (key, value) { | 8975 | $("#backdrop > #searchListDiv > #termlistfilter > li").each(function (key, value) { |
8967 | if ($(this).find("a").html() == document.getElementById("typedTermName").value) { | 8976 | if ($(this).find("a").html() == document.getElementById("typedTermName").value) { |
8968 | $("#termlistfilter li a").css({ "background-color": "#ffffff", "color": "#000000" }); | 8977 | $("#termlistfilter li a").css({ "background-color": "#ffffff", "color": "#000000" }); |
8969 | $(this).find("a").css({ "background-color": "#3399FF", "color": "#ffffff" }); | 8978 | $(this).find("a").css({ "background-color": "#3399FF", "color": "#ffffff" }); |
8970 | } | 8979 | } |
8971 | }); | 8980 | }); |
8972 | - }, 100); | ||
8973 | - $timeout(function () { | ||
8974 | $rootScope.searchListArray = []; | 8981 | $rootScope.searchListArray = []; |
8975 | $("#backdrop > #searchListDiv > #termlistfilter > li").each(function (key, value) { | 8982 | $("#backdrop > #searchListDiv > #termlistfilter > li").each(function (key, value) { |
8976 | $rootScope.searchListArray.push({ "name": $(this).find("a").html(), "id": $(this).find("a").attr("id") }); | 8983 | $rootScope.searchListArray.push({ "name": $(this).find("a").html(), "id": $(this).find("a").attr("id") }); |
8977 | }); | 8984 | }); |
8978 | - }, 100); | 8985 | + |
8979 | 8986 | ||
8980 | } | 8987 | } |
8981 | else { | 8988 | else { |
8982 | $rootScope.loadSearchData(); | 8989 | $rootScope.loadSearchData(); |
8983 | - //if ($rootScope.vocabTermDataArray[primaryLexiconIndx].vocabTermTxt.length > 0) { | ||
8984 | - // $scope.ShowSearch(); | ||
8985 | - //} | ||
8986 | } | 8990 | } |
8987 | }, 500); | 8991 | }, 500); |
8988 | 8992 | ||
@@ -9813,13 +9817,15 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$filter","$ | @@ -9813,13 +9817,15 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$filter","$ | ||
9813 | if ($('#searchListDiv').html() != "") { | 9817 | if ($('#searchListDiv').html() != "") { |
9814 | $('#searchListDiv').empty(); | 9818 | $('#searchListDiv').empty(); |
9815 | } | 9819 | } |
9820 | + //Bug 39757 | ||
9821 | + $timeout(function () { | ||
9816 | $rootScope.a = $scope.primaryLexiconInd; | 9822 | $rootScope.a = $scope.primaryLexiconInd; |
9817 | 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">' + | 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">' + |
9818 | '<a id="{{item._ActualTermNumber}}" href="" onclick="selectTerm(event)">{{item._TermText}}</a>' + | 9824 | '<a id="{{item._ActualTermNumber}}" href="" onclick="selectTerm(event)">{{item._TermText}}</a>' + |
9819 | ' </li></ul>').appendTo('#searchListDiv') | 9825 | ' </li></ul>').appendTo('#searchListDiv') |
9820 | $compile($e2)($scope); | 9826 | $compile($e2)($scope); |
9821 | document.getElementById("termlistfilter").style.display = "block"; | 9827 | document.getElementById("termlistfilter").style.display = "block"; |
9822 | - $timeout(function () { | 9828 | + |
9823 | $("#backdrop > #searchListDiv > #termlistfilter > li").each(function (key, value) { | 9829 | $("#backdrop > #searchListDiv > #termlistfilter > li").each(function (key, value) { |
9824 | if ($(this).find("a").html() == document.getElementById("typedTermName").value) { | 9830 | if ($(this).find("a").html() == document.getElementById("typedTermName").value) { |
9825 | $("#termlistfilter li a").css({ "background-color": "#ffffff", "color": "#000000" }); | 9831 | $("#termlistfilter li a").css({ "background-color": "#ffffff", "color": "#000000" }); |
@@ -9913,7 +9919,8 @@ function enableShowHideStructureBox() { | @@ -9913,7 +9919,8 @@ function enableShowHideStructureBox() { | ||
9913 | function OnSearch() { | 9919 | function OnSearch() { |
9914 | console.log('Show Search is called outside '); | 9920 | console.log('Show Search is called outside '); |
9915 | var scope = angular.element(document.getElementById("daView")).scope(); | 9921 | var scope = angular.element(document.getElementById("daView")).scope(); |
9916 | - scope.$apply(function () { | 9922 | + //Bug 39757 |
9923 | + scope.$evalAsync(function () { | ||
9917 | scope.ShowSearch(); | 9924 | scope.ShowSearch(); |
9918 | }); | 9925 | }); |
9919 | } | 9926 | } |
400-SOURCECODE/AIAHTML5.Web/app/filters/AIAFilter.js
@@ -2,15 +2,19 @@ | @@ -2,15 +2,19 @@ | ||
2 | return function (items, letter) { | 2 | return function (items, letter) { |
3 | 3 | ||
4 | var filtered = []; | 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 | return filtered; | 18 | return filtered; |
15 | }; | 19 | }; |
16 | }); | 20 | }); |
17 | \ No newline at end of file | 21 | \ No newline at end of file |