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