diff --git a/400-SOURCECODE/AIAHTML5.Web/app/controllers/TileViewListController.js b/400-SOURCECODE/AIAHTML5.Web/app/controllers/TileViewListController.js index 738e599..0d34178 100644 --- a/400-SOURCECODE/AIAHTML5.Web/app/controllers/TileViewListController.js +++ b/400-SOURCECODE/AIAHTML5.Web/app/controllers/TileViewListController.js @@ -827,6 +827,7 @@ function ($scope, $window, $rootScope, $compile, $http, $log, $location, $timeou } $scope.listMangerID = []; $scope.showAnnotation = function (selectedPinData, isCtrlPressed, isPinClicked, isItemSearched) { + $scope.clickedPins = []; $scope.selectedPin = []; var isSameTermWithMultiPin = false; @@ -840,7 +841,7 @@ function ($scope, $window, $rootScope, $compile, $http, $log, $location, $timeou .from($scope.aaPinData) .where("_TermId == " + pinTermNumber) .select(); - console.log(pinDataWithFirstTermNumber); + $scope.listMangerID = []; $scope.activePinArray = []; for (var i = 0; i <= pinDataWithFirstTermNumber.length - 1; i++) { @@ -848,13 +849,14 @@ function ($scope, $window, $rootScope, $compile, $http, $log, $location, $timeou $scope.activePinArray.push('PinArc_' + pinDataWithFirstTermNumber[i]._PinId); } - + + console.log($scope.listMangerID); $scope.MultiLanguageAnnationArray = []; - + $scope.GetAnnotationBasedOnActualTermNo(pinTermNumber); if (isCtrlPressed) { @@ -1372,7 +1374,6 @@ function ($scope, $window, $rootScope, $compile, $http, $log, $location, $timeou }); $rootScope.loadSearchData = function () { - //$("#termList").find("option").css({ "background-color": "#ffffff", "color": "#000000" }); var imageId = $rootScope.imageId; var promise = ModuleService.getTermTextDataForAAImage(imageId) @@ -1380,7 +1381,7 @@ function ($scope, $window, $rootScope, $compile, $http, $log, $location, $timeou function (response) { $scope.AAPinTermData = response.data.PinTermData.TermData; - + $rootScope.isLoading = false; $('#setting-spinner').css('visibility', 'hidden'); @@ -1407,7 +1408,7 @@ function ($scope, $window, $rootScope, $compile, $http, $log, $location, $timeou $scope.$watch('$scope.pinTermData', function (newValue, oldValue, scope) { - + if (($('#termlistfilter').html() != "")) $('#termlistfilter').empty(); @@ -1476,15 +1477,17 @@ function ($scope, $window, $rootScope, $compile, $http, $log, $location, $timeou $rootScope.refreshTermListOnAASystemSelection = function (bodySystemId) { + $rootScope.bodySystemSeletedId = bodySystemId; $("#AABodySystems").find("option").css({ "background-color": "#ffffff", "color": "#000000" }); $("#AABodySystems").find("option[id=" + bodySystemId + "]").css({ "background-color": "#3399FF", "color": "#ffffff" }); $('#termList').empty(); var bodySystemName = $("#AABodySystems #" + bodySystemId).val(); + if (bodySystemName == "All") { for (var j = 0; j <= $scope.pinTermData.length - 1; j++) { var $selectedOptions = $('').appendTo("#termList") - + $compile($selectedOptions)($scope); } $("#totalTerms").empty(); @@ -1505,50 +1508,62 @@ function ($scope, $window, $rootScope, $compile, $http, $log, $location, $timeou $(result.PinTermData.TermData).each(function (key, value) { $rootScope.bodySystemTermArray.push({ "termNumbr": result.PinTermData.TermData[key]._TermNumber, "text": result.PinTermData.TermData[key]._TermText, "language": result.PinTermData.TermData[key]._LanguageId }); }); + + for (var i = 0; i <= $scope.aaPinData.length - 1; i++) { + if ($scope.aaPinData[i]._BodySystemName.toLowerCase() == bodySystemName.toLowerCase()) { + for (var j = 0 ; j <= $rootScope.bodySystemTermArray.length - 1; j++) { if ($scope.aaPinData[i]._TermId == $rootScope.bodySystemTermArray[j].termNumbr) { if ($rootScope.bodySystemTermArray[j].language == $rootScope.lexiconLanguageArray[0].id) { - console.log($rootScope.bodySystemTermArray[j].text); $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); } } } } } - var temp = []; - for (var i = 0; i <= $rootScope.duplicateListArray.length - 1; i++) { - var termID = $rootScope.duplicateListArray[i].id; - if ($.inArray(termID, temp) == -1) { - temp.push(termID); - $rootScope.sortedListArray.push({ "title": $rootScope.duplicateListArray[i].title, "id": termID }); - } - } - - 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].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; + // } + // } + //} for (var j = 0; j <= $rootScope.sortedListArray.length - 1; j++) { - var $selectedOptions = $('').appendTo("#termList") + var $selectedOptions = $('').appendTo("#termList"); + + $compile($selectedOptions)($scope); } } @@ -1568,7 +1583,7 @@ function ($scope, $window, $rootScope, $compile, $http, $log, $location, $timeou .from($scope.AAPinTermData) .where('_TermNumber == ' + actualTermNo) .select(); - + if ($scope.matchedTermNoData != null || $scope.matchedTermNoData != undefined) { for (var j = 0; j <= languageArray.length - 1; j++) { @@ -1806,8 +1821,8 @@ function ($scope, $window, $rootScope, $compile, $http, $log, $location, $timeou $scope.highlightPinBasedOnSerachItem = function (id) { $scope.searchItemId = id; - $scope.searchItemText = $("#" + id).text(); - $rootScope.searchSelectedText = $("#" + id).text(); + $scope.searchItemText = $("#" + id).val(); + $rootScope.searchSelectedText = $("#" + id).val(); $('#termList option[selected="selected"]').prop("selected", false); $('#termList option[value="' + $rootScope.searchSelectedText + '"]').prop("selected", true); $("#termList").find("option").css({ "background-color": "#ffffff", "color": "#000000" }); @@ -1815,9 +1830,9 @@ function ($scope, $window, $rootScope, $compile, $http, $log, $location, $timeou $("#termlistfilter li a").css({ "background-color": "#ffffff", "color": "#000000" }); $("#termlistfilter li #" + $scope.searchItemId).css({ "background-color": "#3399FF", "color": "#ffffff" }); - $scope.searchFilter = $("#" + id).text(); + $scope.searchFilter = $("#" + id).val(); //selectedTermName.placeholder = $("#" + id).text(); - selectedTermName.value = $("#" + id).text(); + selectedTermName.value = $("#" + id).val(); selectedTermName.placeholder = "search... "; //get data from pindata for this trem @@ -1826,7 +1841,7 @@ function ($scope, $window, $rootScope, $compile, $http, $log, $location, $timeou .from($scope.aaPinData) .where("_TermId == " + $scope.searchItemId) .select(); - + $scope.showAnnotation(pinDataForTerm, false, false, true); // maintaing scroll position on selection of options in list manager. var annotationTopPos = $(".common-drag").css("top").split("p"); @@ -2021,6 +2036,7 @@ function ($scope, $window, $rootScope, $compile, $http, $log, $location, $timeou function refreshTermListOnSystemSel(bodySystemId) { + var rootScope = angular.element(document.getElementById("aaDetailPageDiv")).scope(); rootScope.$apply(function () { rootScope.refreshTermListOnAASystemSelection(bodySystemId); @@ -2069,7 +2085,7 @@ function hideSearchList(event) { } function onSearchItemSelection(id) { - + console.log('AA hide search is called'); var scope = angular.element(document.getElementById("aaDetailPageDiv")).scope(); scope.$apply(function () {