Commit 4d8a6b4733d8135be80c828a340be338133acd84
Merge branch 'Bug#4471' into QA
Showing
1 changed file
with
34 additions
and
29 deletions
400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js
... | ... | @@ -8357,59 +8357,64 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l |
8357 | 8357 | |
8358 | 8358 | |
8359 | 8359 | var vocabTermTxt = []; |
8360 | + if ($rootScope.TermNumberData != null || $rootScope.TermNumberData != undefined && $rootScope.TermNumberData.length > 0) { | |
8361 | + angular.forEach($rootScope.TermNumberData.TermData.Term, function (value1, key1) { | |
8360 | 8362 | |
8361 | - angular.forEach($rootScope.TermNumberData.TermData.Term, function (value1, key1) { | |
8363 | + angular.forEach($rootScope.vocabTermDataArray[0].VocabTermData.VocabTerms.Term, function (value2, key2) { | |
8362 | 8364 | |
8363 | - angular.forEach($rootScope.vocabTermDataArray[0].VocabTermData.VocabTerms.Term, function (value2, key2) { | |
8364 | 8365 | |
8366 | + if (value1._ActualTermNumber === value2._ActualTermNumber) { | |
8367 | + vocabTermTxt.push( | |
8365 | 8368 | |
8366 | - if (value1._ActualTermNumber === value2._ActualTermNumber) { | |
8367 | - vocabTermTxt.push( | |
8369 | + { | |
8368 | 8370 | |
8369 | - { | |
8371 | + "_ActualTermNumber": value2._ActualTermNumber, | |
8372 | + "_TermText": value2._TermText, | |
8373 | + "_cdId": value2._cdId | |
8370 | 8374 | |
8371 | - "_ActualTermNumber": value2._ActualTermNumber, | |
8372 | - "_TermText": value2._TermText, | |
8373 | - "_cdId": value2._cdId | |
8375 | + } | |
8374 | 8376 | |
8375 | - } | |
8376 | - | |
8377 | - ); | |
8377 | + ); | |
8378 | 8378 | |
8379 | - } | |
8379 | + } | |
8380 | 8380 | |
8381 | - }) | |
8381 | + }) | |
8382 | 8382 | |
8383 | 8383 | |
8384 | 8384 | |
8385 | - }) | |
8385 | + }) | |
8386 | 8386 | |
8387 | 8387 | |
8388 | 8388 | |
8389 | - $scope.VocabTermTxt = new jinqJs() | |
8390 | - .from(vocabTermTxt) | |
8391 | - .distinct('_TermText', '_ActualTermNumber') | |
8392 | - .orderBy([{ field: '_TermText', sort: 'asc' }]) | |
8393 | - .select('_ActualTermNumber', '_TermText', '_cdId'); | |
8389 | + $scope.VocabTermTxt = new jinqJs() | |
8390 | + .from(vocabTermTxt) | |
8391 | + .distinct('_TermText', '_ActualTermNumber') | |
8392 | + .orderBy([{ field: '_TermText', sort: 'asc' }]) | |
8393 | + .select('_ActualTermNumber', '_TermText', '_cdId'); | |
8394 | 8394 | |
8395 | - if ($scope.VocabTermTxt != null || $scope.VocabTermTxt != undefined) { | |
8395 | + if ($scope.VocabTermTxt != null || $scope.VocabTermTxt != undefined) { | |
8396 | 8396 | |
8397 | 8397 | |
8398 | - for (var j = 0; j < $scope.VocabTermTxt.length; j++) { | |
8399 | - var $el = $('<option title ="' + $scope.VocabTermTxt[j]._TermText + '" id=' + $scope.VocabTermTxt[j]._ActualTermNumber + '>' + $scope.VocabTermTxt[j]._TermText + '</option>').appendTo('#termList') | |
8400 | - $compile($el)($scope); | |
8398 | + for (var j = 0; j < $scope.VocabTermTxt.length; j++) { | |
8399 | + var $el = $('<option title ="' + $scope.VocabTermTxt[j]._TermText + '" id=' + $scope.VocabTermTxt[j]._ActualTermNumber + '>' + $scope.VocabTermTxt[j]._TermText + '</option>').appendTo('#termList') | |
8400 | + $compile($el)($scope); | |
8401 | 8401 | |
8402 | - } | |
8402 | + } | |
8403 | 8403 | |
8404 | - $rootScope.isLoading = false; | |
8405 | - $('#spinner').css('visibility', 'hidden'); | |
8404 | + $rootScope.isLoading = false; | |
8405 | + $('#spinner').css('visibility', 'hidden'); | |
8406 | 8406 | |
8407 | - var termsTotal = '<span class="pull-left marginTop5">' + $scope.VocabTermTxt.length + ' Structures</span>'; | |
8408 | - $("#totalTerms").empty(); | |
8409 | - $('#totalTerms').append(termsTotal); | |
8407 | + var termsTotal = '<span class="pull-left marginTop5">' + $scope.VocabTermTxt.length + ' Structures</span>'; | |
8408 | + $("#totalTerms").empty(); | |
8409 | + $('#totalTerms').append(termsTotal); | |
8410 | 8410 | |
8411 | 8411 | |
8412 | 8412 | |
8413 | + } | |
8414 | + } | |
8415 | + else { | |
8416 | + $scope.loadSearchData(); | |
8417 | + $scope.loadListManger(); | |
8413 | 8418 | } |
8414 | 8419 | } |
8415 | 8420 | ... | ... |