Commit 17602650bae3e52be4c0534573eae58b0ba76edd
1 parent
fbb97802
getting undefied error on MAC for vocabTermDataArray so called the loadSearchData().
Need to test.
Showing
1 changed file
with
48 additions
and
40 deletions
400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js
... | ... | @@ -1651,7 +1651,7 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l |
1651 | 1651 | annotationText = $scope.GetAnnotationText(parseInt(RGBColor)); |
1652 | 1652 | } |
1653 | 1653 | else { |
1654 | - $scope.loadSearchData(); | |
1654 | + $rootScope.loadSearchData(); | |
1655 | 1655 | annotationText = $scope.GetAnnotationText(parseInt(RGBColor)); |
1656 | 1656 | } |
1657 | 1657 | |
... | ... | @@ -2026,7 +2026,7 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l |
2026 | 2026 | |
2027 | 2027 | } |
2028 | 2028 | else { |
2029 | - $scope.loadSearchData(); | |
2029 | + $rootScope.loadSearchData(); | |
2030 | 2030 | annotationText = $scope.GetAnnotationText(parseInt(RGBColor)); |
2031 | 2031 | |
2032 | 2032 | } |
... | ... | @@ -8739,76 +8739,84 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l |
8739 | 8739 | |
8740 | 8740 | $scope.loadListManger = function () { |
8741 | 8741 | var primaryLexiconIndex; |
8742 | - for (var i = 0; i <= $rootScope.vocabTermDataArray.length - 1; i++) { | |
8743 | - if ($rootScope.vocabTermDataArray[i].language == $rootScope.lexiconLanguageArray[0].language) { | |
8744 | - primaryLexiconIndex = i; | |
8742 | + if ($rootScope.vocabTermDataArray != null && $rootScope.vocabTermDataArray != undefined && $rootScope.vocabTermDataArray.length > 0) { | |
8743 | + | |
8744 | + for (var i = 0; i <= $rootScope.vocabTermDataArray.length - 1; i++) { | |
8745 | + if ($rootScope.vocabTermDataArray[i].language == $rootScope.lexiconLanguageArray[0].language) { | |
8746 | + primaryLexiconIndex = i; | |
8747 | + } | |
8745 | 8748 | } |
8746 | - } | |
8747 | - console.log($rootScope.vocabTermDataArray[primaryLexiconIndex].language); | |
8748 | - $rootScope.isListManagerMenuSelected = true; | |
8749 | + console.log($rootScope.vocabTermDataArray[primaryLexiconIndex].language); | |
8750 | + $rootScope.isListManagerMenuSelected = true; | |
8749 | 8751 | |
8750 | - var vocabTermTxt = []; | |
8751 | - if ($rootScope.TermNumberData != null || $rootScope.TermNumberData != undefined && $rootScope.TermNumberData.length > 0) { | |
8752 | - angular.forEach($rootScope.TermNumberData.TermData.Term, function (value1, key1) { | |
8752 | + var vocabTermTxt = []; | |
8753 | + if ($rootScope.TermNumberData != null || $rootScope.TermNumberData != undefined && $rootScope.TermNumberData.length > 0) { | |
8754 | + angular.forEach($rootScope.TermNumberData.TermData.Term, function (value1, key1) { | |
8753 | 8755 | |
8754 | - angular.forEach($rootScope.vocabTermDataArray[primaryLexiconIndex].VocabTermData.VocabTerms.Term, function (value2, key2) { | |
8756 | + angular.forEach($rootScope.vocabTermDataArray[primaryLexiconIndex].VocabTermData.VocabTerms.Term, function (value2, key2) { | |
8755 | 8757 | |
8756 | 8758 | |
8757 | - if (value1._ActualTermNumber === value2._ActualTermNumber) { | |
8758 | - vocabTermTxt.push( | |
8759 | + if (value1._ActualTermNumber === value2._ActualTermNumber) { | |
8760 | + vocabTermTxt.push( | |
8759 | 8761 | |
8760 | - { | |
8762 | + { | |
8761 | 8763 | |
8762 | - "_ActualTermNumber": value2._ActualTermNumber, | |
8763 | - "_TermText": value2._TermText, | |
8764 | - "_cdId": value2._cdId | |
8764 | + "_ActualTermNumber": value2._ActualTermNumber, | |
8765 | + "_TermText": value2._TermText, | |
8766 | + "_cdId": value2._cdId | |
8765 | 8767 | |
8766 | - } | |
8768 | + } | |
8767 | 8769 | |
8768 | - ); | |
8770 | + ); | |
8769 | 8771 | |
8770 | - } | |
8772 | + } | |
8771 | 8773 | |
8772 | - }) | |
8774 | + }) | |
8773 | 8775 | |
8774 | 8776 | |
8775 | 8777 | |
8776 | - }) | |
8778 | + }) | |
8777 | 8779 | |
8778 | 8780 | |
8779 | 8781 | |
8780 | - $scope.VocabTermTxt = new jinqJs() | |
8781 | - .from(vocabTermTxt) | |
8782 | - .distinct('_TermText', '_ActualTermNumber') | |
8783 | - .orderBy([{ field: '_TermText', sort: 'asc' }]) | |
8784 | - .select('_ActualTermNumber', '_TermText', '_cdId'); | |
8782 | + $scope.VocabTermTxt = new jinqJs() | |
8783 | + .from(vocabTermTxt) | |
8784 | + .distinct('_TermText', '_ActualTermNumber') | |
8785 | + .orderBy([{ field: '_TermText', sort: 'asc' }]) | |
8786 | + .select('_ActualTermNumber', '_TermText', '_cdId'); | |
8785 | 8787 | |
8786 | - if ($scope.VocabTermTxt != null || $scope.VocabTermTxt != undefined) { | |
8788 | + if ($scope.VocabTermTxt != null || $scope.VocabTermTxt != undefined) { | |
8787 | 8789 | |
8788 | 8790 | |
8789 | - for (var j = 0; j < $scope.VocabTermTxt.length; j++) { | |
8790 | - var $el = $('<option title ="' + $scope.VocabTermTxt[j]._TermText + '" id=' + $scope.VocabTermTxt[j]._ActualTermNumber + '>' + $scope.VocabTermTxt[j]._TermText + '</option>').appendTo('#termList') | |
8791 | - $compile($el)($scope); | |
8791 | + for (var j = 0; j < $scope.VocabTermTxt.length; j++) { | |
8792 | + var $el = $('<option title ="' + $scope.VocabTermTxt[j]._TermText + '" id=' + $scope.VocabTermTxt[j]._ActualTermNumber + '>' + $scope.VocabTermTxt[j]._TermText + '</option>').appendTo('#termList') | |
8793 | + $compile($el)($scope); | |
8792 | 8794 | |
8793 | - } | |
8795 | + } | |
8794 | 8796 | |
8795 | - $rootScope.isLoading = false; | |
8796 | - $('#spinner').css('visibility', 'hidden'); | |
8797 | + $rootScope.isLoading = false; | |
8798 | + $('#spinner').css('visibility', 'hidden'); | |
8797 | 8799 | |
8798 | - var termsTotal = '<span class="pull-left marginTop5">' + $scope.VocabTermTxt.length + ' Structures</span>'; | |
8799 | - $("#totalTerms").empty(); | |
8800 | - $('#totalTerms').append(termsTotal); | |
8800 | + var termsTotal = '<span class="pull-left marginTop5">' + $scope.VocabTermTxt.length + ' Structures</span>'; | |
8801 | + $("#totalTerms").empty(); | |
8802 | + $('#totalTerms').append(termsTotal); | |
8801 | 8803 | |
8802 | 8804 | |
8803 | 8805 | |
8806 | + } | |
8807 | + } | |
8808 | + else { | |
8809 | + console.log("$rootScope.TermNumberData NOT FOUND"); | |
8810 | + $rootScope.loadSearchData(); | |
8811 | + | |
8804 | 8812 | } |
8805 | 8813 | } |
8806 | 8814 | else { |
8807 | - console.log("$rootScope.TermNumberData NOT FOUND"); | |
8808 | - $scope.loadSearchData(); | |
8815 | + $rootScope.loadSearchData(); | |
8809 | 8816 | |
8810 | 8817 | } |
8811 | 8818 | } |
8819 | + | |
8812 | 8820 | |
8813 | 8821 | |
8814 | 8822 | $scope.HighlightBodyOnListManagerSelection = function (actualTermNumber, isTermListOptionClicked) { | ... | ... |