diff --git a/400-SOURCECODE/AIAHTML5.Web/app/controllers/TileViewListController.js b/400-SOURCECODE/AIAHTML5.Web/app/controllers/TileViewListController.js index 0d34178..9b57bab 100644 --- a/400-SOURCECODE/AIAHTML5.Web/app/controllers/TileViewListController.js +++ b/400-SOURCECODE/AIAHTML5.Web/app/controllers/TileViewListController.js @@ -1519,7 +1519,7 @@ function ($scope, $window, $rootScope, $compile, $http, $log, $location, $timeou if ($rootScope.bodySystemTermArray[j].language == $rootScope.lexiconLanguageArray[0].id) { $rootScope.duplicateListArray.push({ "title": $rootScope.bodySystemTermArray[j].text, "id": $rootScope.bodySystemTermArray[j].termNumbr }); - $rootScope.sortedListArray.push({ "title": $rootScope.bodySystemTermArray[j].text, "id": $rootScope.bodySystemTermArray[j].termNumbr }); + // console.log($rootScope.bodySystemTermArray); } @@ -1527,38 +1527,38 @@ function ($scope, $window, $rootScope, $compile, $http, $log, $location, $timeou } } } - //var temp = []; - //console.log($rootScope.duplicateListArray); - //for (var i = 0; i <= $rootScope.duplicateListArray.length - 1; i++) { - // var termID = $rootScope.duplicateListArray[i].id; - // if ($.inArray(termID, temp) == -1) { - // temp.push(termID); - // console.log('1'+$rootScope.duplicateListArray[i].title + " " + $rootScope.duplicateListArray[i].id); - // $rootScope.sortedListArray.push({ "title": $rootScope.duplicateListArray[i].title, "id": termID }); - // console.log('3' + $rootScope.sortedListArray[i].title + " " + $rootScope.sortedListArray[i].id) - // } - //} - //console.log('2'+$rootScope.sortedListArray); - //for (var i = 0; i <= $rootScope.sortedListArray.length - 1; i++) { - - // for (j = i + 1; j <= $rootScope.sortedListArray.length - 1; j++) { + var temp = []; + console.log($rootScope.duplicateListArray); + for (var i = 0; i <= $rootScope.duplicateListArray.length - 1; i++) { + var termID = $rootScope.duplicateListArray[i].id; + if ($.inArray(termID, temp) == -1) { + temp.push(termID); + console.log('1'+$rootScope.duplicateListArray[i].title + " " + $rootScope.duplicateListArray[i].id); + $rootScope.sortedListArray.push({ "title": $rootScope.duplicateListArray[i].title, "id": termID }); + console.log('3' + $rootScope.sortedListArray[i].title + " " + $rootScope.sortedListArray[i].id) + } + } + console.log('2'+$rootScope.sortedListArray); + for (var i = 0; i <= $rootScope.sortedListArray.length - 1; i++) { + + for (j = i + 1; j <= $rootScope.sortedListArray.length - 1; j++) { - // if ($rootScope.sortedListArray[i].title.substr(0, 1) > $rootScope.sortedListArray[j].title.substr(0, 1)) { - - // var termText = $rootScope.sortedListArray[i].title; - // var termNumbr = $rootScope.sortedListArray[i].termNumbr; - // var termLanguage = $rootScope.sortedListArray[i].language; - - // $rootScope.sortedListArray[i].title = $rootScope.sortedListArray[j].title; - // $rootScope.sortedListArray[i].termNumbr = $rootScope.sortedListArray[j].termNumbr; - // $rootScope.sortedListArray[i].language = $rootScope.sortedListArray[j].language; - - // $rootScope.sortedListArray[j].title = termText; - // $rootScope.sortedListArray[j].termNumbr = termNumbr; - // $rootScope.sortedListArray[j].language = termLanguage; - // } - // } - //} + if ($rootScope.sortedListArray[i].title.substr(0, 1) > $rootScope.sortedListArray[j].title.substr(0, 1)) { + + var termText = $rootScope.sortedListArray[i].title; + var termNumbr = $rootScope.sortedListArray[i].id; + var termLanguage = $rootScope.sortedListArray[i].language; + + $rootScope.sortedListArray[i].title = $rootScope.sortedListArray[j].title; + $rootScope.sortedListArray[i].id = $rootScope.sortedListArray[j].id; + $rootScope.sortedListArray[i].language = $rootScope.sortedListArray[j].language; + + $rootScope.sortedListArray[j].title = termText; + $rootScope.sortedListArray[j].id = termNumbr; + $rootScope.sortedListArray[j].language = termLanguage; + } + } + } for (var j = 0; j <= $rootScope.sortedListArray.length - 1; j++) { var $selectedOptions = $('').appendTo("#termList");