Commit 96751b7c3bc5e0c1d4e15af4c00a1e9e0c6fd640

Authored by Nikita Kulshreshtha
2 parents cc911266 7e16be0d

Merge branch 'ListmanagerAAselectissue' into Develop

400-SOURCECODE/AIAHTML5.Web/app/controllers/TileViewListController.js
... ... @@ -827,6 +827,7 @@ function ($scope, $window, $rootScope, $compile, $http, $log, $location, $timeou
827 827 }
828 828 $scope.listMangerID = [];
829 829 $scope.showAnnotation = function (selectedPinData, isCtrlPressed, isPinClicked, isItemSearched) {
  830 +
830 831 $scope.clickedPins = [];
831 832 $scope.selectedPin = [];
832 833 var isSameTermWithMultiPin = false;
... ... @@ -840,7 +841,7 @@ function ($scope, $window, $rootScope, $compile, $http, $log, $location, $timeou
840 841 .from($scope.aaPinData)
841 842 .where("_TermId == " + pinTermNumber)
842 843 .select();
843   - console.log(pinDataWithFirstTermNumber);
  844 +
844 845 $scope.listMangerID = [];
845 846 $scope.activePinArray = [];
846 847 for (var i = 0; i <= pinDataWithFirstTermNumber.length - 1; i++) {
... ... @@ -848,13 +849,14 @@ function ($scope, $window, $rootScope, $compile, $http, $log, $location, $timeou
848 849 $scope.activePinArray.push('PinArc_' + pinDataWithFirstTermNumber[i]._PinId);
849 850 }
850 851  
851   -
  852 +
  853 +
852 854  
853 855  
854 856  
855 857 console.log($scope.listMangerID);
856 858 $scope.MultiLanguageAnnationArray = [];
857   -
  859 +
858 860 $scope.GetAnnotationBasedOnActualTermNo(pinTermNumber);
859 861  
860 862 if (isCtrlPressed) {
... ... @@ -1372,7 +1374,6 @@ function ($scope, $window, $rootScope, $compile, $http, $log, $location, $timeou
1372 1374 });
1373 1375  
1374 1376 $rootScope.loadSearchData = function () {
1375   -
1376 1377 //$("#termList").find("option").css({ "background-color": "#ffffff", "color": "#000000" });
1377 1378 var imageId = $rootScope.imageId;
1378 1379 var promise = ModuleService.getTermTextDataForAAImage(imageId)
... ... @@ -1380,7 +1381,7 @@ function ($scope, $window, $rootScope, $compile, $http, $log, $location, $timeou
1380 1381 function (response) {
1381 1382  
1382 1383 $scope.AAPinTermData = response.data.PinTermData.TermData;
1383   -
  1384 +
1384 1385 $rootScope.isLoading = false;
1385 1386 $('#setting-spinner').css('visibility', 'hidden');
1386 1387  
... ... @@ -1407,7 +1408,7 @@ function ($scope, $window, $rootScope, $compile, $http, $log, $location, $timeou
1407 1408  
1408 1409  
1409 1410 $scope.$watch('$scope.pinTermData', function (newValue, oldValue, scope) {
1410   -
  1411 +
1411 1412 if (($('#termlistfilter').html() != ""))
1412 1413  
1413 1414 $('#termlistfilter').empty();
... ... @@ -1476,15 +1477,17 @@ function ($scope, $window, $rootScope, $compile, $http, $log, $location, $timeou
1476 1477  
1477 1478  
1478 1479 $rootScope.refreshTermListOnAASystemSelection = function (bodySystemId) {
  1480 +
1479 1481 $rootScope.bodySystemSeletedId = bodySystemId;
1480 1482 $("#AABodySystems").find("option").css({ "background-color": "#ffffff", "color": "#000000" });
1481 1483 $("#AABodySystems").find("option[id=" + bodySystemId + "]").css({ "background-color": "#3399FF", "color": "#ffffff" });
1482 1484 $('#termList').empty();
1483 1485 var bodySystemName = $("#AABodySystems #" + bodySystemId).val();
  1486 +
1484 1487 if (bodySystemName == "All") {
1485 1488 for (var j = 0; j <= $scope.pinTermData.length - 1; j++) {
1486 1489 var $selectedOptions = $('<option title= "' + $scope.pinTermData[j].TermTxt + '" id= "' + $scope.pinTermData[j].TermNumber + '">' + $scope.pinTermData[j].TermTxt + '</option>').appendTo("#termList")
1487   -
  1490 +
1488 1491 $compile($selectedOptions)($scope);
1489 1492 }
1490 1493 $("#totalTerms").empty();
... ... @@ -1505,50 +1508,62 @@ function ($scope, $window, $rootScope, $compile, $http, $log, $location, $timeou
1505 1508 $(result.PinTermData.TermData).each(function (key, value) {
1506 1509 $rootScope.bodySystemTermArray.push({ "termNumbr": result.PinTermData.TermData[key]._TermNumber, "text": result.PinTermData.TermData[key]._TermText, "language": result.PinTermData.TermData[key]._LanguageId });
1507 1510 });
  1511 +
  1512 +
1508 1513 for (var i = 0; i <= $scope.aaPinData.length - 1; i++) {
  1514 +
1509 1515 if ($scope.aaPinData[i]._BodySystemName.toLowerCase() == bodySystemName.toLowerCase()) {
  1516 +
1510 1517 for (var j = 0 ; j <= $rootScope.bodySystemTermArray.length - 1; j++) {
1511 1518 if ($scope.aaPinData[i]._TermId == $rootScope.bodySystemTermArray[j].termNumbr) {
1512 1519 if ($rootScope.bodySystemTermArray[j].language == $rootScope.lexiconLanguageArray[0].id) {
1513   - console.log($rootScope.bodySystemTermArray[j].text);
1514 1520 $rootScope.duplicateListArray.push({ "title": $rootScope.bodySystemTermArray[j].text, "id": $rootScope.bodySystemTermArray[j].termNumbr });
  1521 +
  1522 + $rootScope.sortedListArray.push({ "title": $rootScope.bodySystemTermArray[j].text, "id": $rootScope.bodySystemTermArray[j].termNumbr });
  1523 +
  1524 + // console.log($rootScope.bodySystemTermArray);
1515 1525 }
1516 1526 }
1517 1527 }
1518 1528 }
1519 1529 }
1520   - var temp = [];
1521   - for (var i = 0; i <= $rootScope.duplicateListArray.length - 1; i++) {
1522   - var termID = $rootScope.duplicateListArray[i].id;
1523   - if ($.inArray(termID, temp) == -1) {
1524   - temp.push(termID);
1525   - $rootScope.sortedListArray.push({ "title": $rootScope.duplicateListArray[i].title, "id": termID });
1526   - }
1527   - }
1528   -
1529   - for (var i = 0; i <= $rootScope.sortedListArray.length - 1; i++) {
1530   -
1531   - for (j = i + 1; j <= $rootScope.sortedListArray.length - 1; j++) {
  1530 + //var temp = [];
  1531 + //console.log($rootScope.duplicateListArray);
  1532 + //for (var i = 0; i <= $rootScope.duplicateListArray.length - 1; i++) {
  1533 + // var termID = $rootScope.duplicateListArray[i].id;
  1534 + // if ($.inArray(termID, temp) == -1) {
  1535 + // temp.push(termID);
  1536 + // console.log('1'+$rootScope.duplicateListArray[i].title + " " + $rootScope.duplicateListArray[i].id);
  1537 + // $rootScope.sortedListArray.push({ "title": $rootScope.duplicateListArray[i].title, "id": termID });
  1538 + // console.log('3' + $rootScope.sortedListArray[i].title + " " + $rootScope.sortedListArray[i].id)
  1539 + // }
  1540 + //}
  1541 + //console.log('2'+$rootScope.sortedListArray);
  1542 + //for (var i = 0; i <= $rootScope.sortedListArray.length - 1; i++) {
  1543 +
  1544 + // for (j = i + 1; j <= $rootScope.sortedListArray.length - 1; j++) {
1532 1545  
1533   - if ($rootScope.sortedListArray[i].title.substr(0, 1) > $rootScope.sortedListArray[j].title.substr(0, 1)) {
1534   -
1535   - var termText = $rootScope.sortedListArray[i].title;
1536   - var termNumbr = $rootScope.sortedListArray[i].termNumbr;
1537   - var termLanguage = $rootScope.sortedListArray[i].language;
1538   -
1539   - $rootScope.sortedListArray[i].title = $rootScope.sortedListArray[j].title;
1540   - $rootScope.sortedListArray[i].termNumbr = $rootScope.sortedListArray[j].termNumbr;
1541   - $rootScope.sortedListArray[i].language = $rootScope.sortedListArray[j].language;
1542   -
1543   - $rootScope.sortedListArray[j].title = termText;
1544   - $rootScope.sortedListArray[j].termNumbr = termNumbr;
1545   - $rootScope.sortedListArray[j].language = termLanguage;
1546   - }
1547   - }
1548   - }
  1546 + // if ($rootScope.sortedListArray[i].title.substr(0, 1) > $rootScope.sortedListArray[j].title.substr(0, 1)) {
  1547 +
  1548 + // var termText = $rootScope.sortedListArray[i].title;
  1549 + // var termNumbr = $rootScope.sortedListArray[i].termNumbr;
  1550 + // var termLanguage = $rootScope.sortedListArray[i].language;
  1551 +
  1552 + // $rootScope.sortedListArray[i].title = $rootScope.sortedListArray[j].title;
  1553 + // $rootScope.sortedListArray[i].termNumbr = $rootScope.sortedListArray[j].termNumbr;
  1554 + // $rootScope.sortedListArray[i].language = $rootScope.sortedListArray[j].language;
  1555 +
  1556 + // $rootScope.sortedListArray[j].title = termText;
  1557 + // $rootScope.sortedListArray[j].termNumbr = termNumbr;
  1558 + // $rootScope.sortedListArray[j].language = termLanguage;
  1559 + // }
  1560 + // }
  1561 + //}
1549 1562  
1550 1563 for (var j = 0; j <= $rootScope.sortedListArray.length - 1; j++) {
1551   - var $selectedOptions = $('<option title= "' + $rootScope.sortedListArray[j].title + '" id= "' + $rootScope.sortedListArray[j].id + '" >' + $rootScope.sortedListArray[j].title + '</option>').appendTo("#termList")
  1564 + var $selectedOptions = $('<option title= "' + $rootScope.sortedListArray[j].title + '" id= "' + $rootScope.sortedListArray[j].id + '" >' + $rootScope.sortedListArray[j].title + '</option>').appendTo("#termList");
  1565 +
  1566 +
1552 1567 $compile($selectedOptions)($scope);
1553 1568 }
1554 1569 }
... ... @@ -1568,7 +1583,7 @@ function ($scope, $window, $rootScope, $compile, $http, $log, $location, $timeou
1568 1583 .from($scope.AAPinTermData)
1569 1584 .where('_TermNumber == ' + actualTermNo)
1570 1585 .select();
1571   -
  1586 +
1572 1587 if ($scope.matchedTermNoData != null || $scope.matchedTermNoData != undefined) {
1573 1588  
1574 1589 for (var j = 0; j <= languageArray.length - 1; j++) {
... ... @@ -1806,8 +1821,8 @@ function ($scope, $window, $rootScope, $compile, $http, $log, $location, $timeou
1806 1821  
1807 1822 $scope.highlightPinBasedOnSerachItem = function (id) {
1808 1823 $scope.searchItemId = id;
1809   - $scope.searchItemText = $("#" + id).text();
1810   - $rootScope.searchSelectedText = $("#" + id).text();
  1824 + $scope.searchItemText = $("#" + id).val();
  1825 + $rootScope.searchSelectedText = $("#" + id).val();
1811 1826 $('#termList option[selected="selected"]').prop("selected", false);
1812 1827 $('#termList option[value="' + $rootScope.searchSelectedText + '"]').prop("selected", true);
1813 1828 $("#termList").find("option").css({ "background-color": "#ffffff", "color": "#000000" });
... ... @@ -1815,9 +1830,9 @@ function ($scope, $window, $rootScope, $compile, $http, $log, $location, $timeou
1815 1830  
1816 1831 $("#termlistfilter li a").css({ "background-color": "#ffffff", "color": "#000000" });
1817 1832 $("#termlistfilter li #" + $scope.searchItemId).css({ "background-color": "#3399FF", "color": "#ffffff" });
1818   - $scope.searchFilter = $("#" + id).text();
  1833 + $scope.searchFilter = $("#" + id).val();
1819 1834 //selectedTermName.placeholder = $("#" + id).text();
1820   - selectedTermName.value = $("#" + id).text();
  1835 + selectedTermName.value = $("#" + id).val();
1821 1836 selectedTermName.placeholder = "search... ";
1822 1837  
1823 1838 //get data from pindata for this trem
... ... @@ -1826,7 +1841,7 @@ function ($scope, $window, $rootScope, $compile, $http, $log, $location, $timeou
1826 1841 .from($scope.aaPinData)
1827 1842 .where("_TermId == " + $scope.searchItemId)
1828 1843 .select();
1829   -
  1844 +
1830 1845 $scope.showAnnotation(pinDataForTerm, false, false, true);
1831 1846 // maintaing scroll position on selection of options in list manager.
1832 1847 var annotationTopPos = $(".common-drag").css("top").split("p");
... ... @@ -2021,6 +2036,7 @@ function ($scope, $window, $rootScope, $compile, $http, $log, $location, $timeou
2021 2036  
2022 2037  
2023 2038 function refreshTermListOnSystemSel(bodySystemId) {
  2039 +
2024 2040 var rootScope = angular.element(document.getElementById("aaDetailPageDiv")).scope();
2025 2041 rootScope.$apply(function () {
2026 2042 rootScope.refreshTermListOnAASystemSelection(bodySystemId);
... ... @@ -2069,7 +2085,7 @@ function hideSearchList(event) {
2069 2085 }
2070 2086  
2071 2087 function onSearchItemSelection(id) {
2072   -
  2088 +
2073 2089 console.log('AA hide search is called');
2074 2090 var scope = angular.element(document.getElementById("aaDetailPageDiv")).scope();
2075 2091 scope.$apply(function () {
... ...