Commit 6b58781764e3b13921ae985784c55a9ebc071b64

Authored by Amrita Vishnoi
2 parents 39a36772 515f0110

Merge branch 'SearchFunctionalityIssue' of http://52.6.196.163/ADAM/AIAHTML5 into Develop-IPAD-MAC

400-SOURCECODE/AIAHTML5.Web/app/controllers/TileViewListController.js
... ... @@ -1310,7 +1310,7 @@ function ($scope, $window, $rootScope, $compile, $http, $log, $location, $timeou
1310 1310 var imageId = $rootScope.imageId;
1311 1311 $scope.pinDataUrl = "aa_dat_pinterm_" + imageId;
1312 1312 $rootScope.bodySystemTermArray = [];
1313   -
  1313 + $rootScope.sortedListArray = [];
1314 1314 $.ajax({
1315 1315 url: '~/../content/data/json/aa/aa_pinterm/' + $scope.pinDataUrl + '.json',
1316 1316 type: 'GET',
... ... @@ -1326,13 +1326,40 @@ function ($scope, $window, $rootScope, $compile, $http, $log, $location, $timeou
1326 1326 if ($scope.aaPinData[i]._TermId == $rootScope.bodySystemTermArray[j].termNumbr) {
1327 1327 if ($rootScope.bodySystemTermArray[j].language == "1") {
1328 1328 console.log($rootScope.bodySystemTermArray[j].text);
1329   - var $selectedOptions = $('<option title= "' + $rootScope.bodySystemTermArray[j].text + '" id= "' + $rootScope.bodySystemTermArray[j].termNumbr + '" >' + $rootScope.bodySystemTermArray[j].text + '</option>').appendTo("#termList")
1330   - $compile($selectedOptions)($scope);
  1329 + $rootScope.sortedListArray.push({ "title": $rootScope.bodySystemTermArray[j].text, "id": $rootScope.bodySystemTermArray[j].termNumbr });
  1330 +
1331 1331 }
1332 1332 }
1333 1333 }
1334 1334 }
1335 1335 }
  1336 +
  1337 +
  1338 + for (var i = 0; i <= $rootScope.sortedListArray.length - 1; i++) {
  1339 +
  1340 + for (j = i + 1; j <= $rootScope.sortedListArray.length - 1; j++) {
  1341 +
  1342 + if ($rootScope.sortedListArray[i].title.substr(0, 1) > $rootScope.sortedListArray[j].title.substr(0, 1)) {
  1343 +
  1344 + var termText = $rootScope.sortedListArray[i].title;
  1345 + var termNumbr = $rootScope.sortedListArray[i].termNumbr;
  1346 + var termLanguage = $rootScope.sortedListArray[i].language;
  1347 +
  1348 + $rootScope.sortedListArray[i].title = $rootScope.sortedListArray[j].title;
  1349 + $rootScope.sortedListArray[i].termNumbr = $rootScope.sortedListArray[j].termNumbr;
  1350 + $rootScope.sortedListArray[i].language = $rootScope.sortedListArray[j].language;
  1351 +
  1352 + $rootScope.sortedListArray[j].title = termText;
  1353 + $rootScope.sortedListArray[j].termNumbr = termNumbr;
  1354 + $rootScope.sortedListArray[j].language = termLanguage;
  1355 + }
  1356 + }
  1357 + }
  1358 +
  1359 + for (var j = 0; j <= $rootScope.sortedListArray.length - 1; j++) {
  1360 + var $selectedOptions = $('<option title= "' + $rootScope.sortedListArray[j].title + '" id= "' + $rootScope.sortedListArray[j].id + '" >' + $rootScope.sortedListArray[j].title + '</option>').appendTo("#termList")
  1361 + $compile($selectedOptions)($scope);
  1362 + }
1336 1363 }
1337 1364 });
1338 1365 $("#totalTerms").empty();
... ...