Commit 68dcf74f32e05f2e61014e37fe00dc58453d1e7f

Authored by Amrita Vishnoi
2 parents 0820419e 02175b3f

Merge branch 'AAPiinIssue_1' into Develop

400-SOURCECODE/AIAHTML5.Web/app/controllers/TileViewListController.js
... ... @@ -775,7 +775,7 @@ function ($scope, $window, $rootScope, $compile, $http, $log, $location, $timeou
775 775 $scope.isBodySystemSelected = false;
776 776 $scope.SelectedSystemTitle = "Current Structure";
777 777 $scope.showSelectedSystemPins = function (event) {
778   -
  778 +
779 779 if (typeof event == "object") {
780 780 if (event.currentTarget.title == $("#bodySystemList li.activeAASystemSelect a").attr("title")) {
781 781  
... ... @@ -821,11 +821,12 @@ function ($scope, $window, $rootScope, $compile, $http, $log, $location, $timeou
821 821 else {
822 822  
823 823 $scope.selectedSystemName = $scope.SelectedSystemTitle;
  824 +
824 825 // get termText info
825 826 var promise = ModuleService.getTermTextDataForPin($scope.moduleName)
826 827 .then(
827 828 function (response) {
828   -
  829 +
829 830 $scope.TermInfo = response.data.Terms.Term;
830 831  
831 832 //on gettng all required data, draw pins
... ... @@ -893,6 +894,7 @@ function ($scope, $window, $rootScope, $compile, $http, $log, $location, $timeou
893 894 {
894 895 $scope.SelectedSystemID = event;
895 896 $scope.SelectedSystemTitle = $("#bodySystemList li.activeAASystemSelect a").attr("title");
  897 +
896 898 $scope.typeOfEvent = typeof event;
897 899 // $scope.isBodySystemSelected = true;
898 900 $rootScope.isShowSelectedSystemPinsClicked = true;
... ... @@ -919,8 +921,9 @@ function ($scope, $window, $rootScope, $compile, $http, $log, $location, $timeou
919 921 }
920 922 }
921 923 else {
922   -
  924 +
923 925 $scope.selectedSystemName = $scope.SelectedSystemTitle;
  926 +
924 927 // get termText info
925 928 var promise = ModuleService.getTermTextDataForPin($scope.moduleName)
926 929 .then(
... ... @@ -934,6 +937,9 @@ function ($scope, $window, $rootScope, $compile, $http, $log, $location, $timeou
934 937 .from($scope.aaPinData)
935 938 .where("_BodySystemName == " + $scope.selectedSystemName)
936 939 .select();
  940 +
  941 + console.log($scope.selectedSystemPinData);
  942 +
937 943 if ($scope.isHidePinBtnClicked) {
938 944 // $scope.showAllPinsAfterHide($scope.selectedSystemPinData);
939 945 $scope.showAllPinsAfterHide();
... ... @@ -973,11 +979,12 @@ function ($scope, $window, $rootScope, $compile, $http, $log, $location, $timeou
973 979 $scope.activePinArray = [];
974 980 $scope.isSearchOptionClicked = false;
975 981 $scope.showAnnotation = function (selectedPinData, isCtrlPressed, isPinClicked, isItemSearched) {
976   -
  982 +
977 983 $scope.selectedPin = [];
978 984 var isSameTermWithMultiPin = false;
979   - var firstPinId = selectedPinData[0]._PinId;
980   - var pinTermNumber = selectedPinData[0]._TermId;
  985 +
  986 + var firstPinId = selectedPinData[0]._PinId;
  987 + var pinTermNumber = selectedPinData[0]._TermId;
981 988  
982 989 //check if other pin have same termNumber
983 990 if ($scope.aaPinData != null && $scope.aaPinData.length > 0) {
... ... @@ -987,11 +994,7 @@ function ($scope, $window, $rootScope, $compile, $http, $log, $location, $timeou
987 994 .where("_TermId == " + pinTermNumber)
988 995 .select();
989 996  
990   - //if ($scope.isSearchOptionClicked == true) {
991   - // $scope.activePinArray = [];
992   - // $scope.clickedPins = [];
993   - // $scope.isSearchOptionClicked = false;
994   - //}
  997 +
995 998 if ($scope.isBodySystemSelected == true) {
996 999  
997 1000 $scope.isSelectedSystemSelectedAftrChange = true;
... ... @@ -1161,6 +1164,7 @@ function ($scope, $window, $rootScope, $compile, $http, $log, $location, $timeou
1161 1164 }
1162 1165 $scope.sliderVal = 100;
1163 1166 $scope.createSpeechBubbleBasedOnAnnotationLength = function (x, y, PinId) {
  1167 +
1164 1168 x = x * $scope.sliderPercentValue;
1165 1169 y = y * $scope.sliderPercentValue;
1166 1170 if ($("#canvasDiv").find("div").length > 0) {
... ... @@ -2003,7 +2007,7 @@ function ($scope, $window, $rootScope, $compile, $http, $log, $location, $timeou
2003 2007 }, 1000);
2004 2008  
2005 2009 }
2006   -
  2010 +
2007 2011 $scope.highlightPinBasedOnSerachItem = function (id) {
2008 2012  
2009 2013 $scope.isSelectedSystemSelectedAftrChange = false;
... ... @@ -2011,10 +2015,11 @@ function ($scope, $window, $rootScope, $compile, $http, $log, $location, $timeou
2011 2015 $scope.listMangerID = [];
2012 2016 $scope.searchItemId = id;
2013 2017  
2014   - $scope.searchItemText = $("#" + id).val();
  2018 + $scope.searchItemText = $("#" + id).val();
2015 2019 $rootScope.searchSelectedText = $("#" + id).val();
2016 2020 $('#termList option[selected="selected"]').prop("selected", false);
2017 2021 $('#termList option[value="' + $rootScope.searchSelectedText + '"]').prop("selected", true);
  2022 +
2018 2023 $("#termList").find("option").css({ "background-color": "#ffffff", "color": "#000000" });
2019 2024 $('#termList option[value="' + $rootScope.searchSelectedText + '"]').css({ "background-color": "#3399FF", "color": "#ffffff" });
2020 2025  
... ... @@ -2024,13 +2029,45 @@ function ($scope, $window, $rootScope, $compile, $http, $log, $location, $timeou
2024 2029 //selectedTermName.placeholder = $("#" + id).text();
2025 2030 selectedTermName.value = $("#" + id).val();
2026 2031 selectedTermName.placeholder = "search... ";
2027   -
2028   - //get data from pindata for this trem
  2032 + if ($("#bodySystemList li.activeAASystemSelect a").attr("id") == 0) {
  2033 + // alert("All");
  2034 + }
  2035 + else
  2036 + {
  2037 + $("#bodySystemList li").each(function () {
  2038 + if ($(this).hasClass("disabledSelectedSystem") || $(this).hasClass("divider") || ($(this).find("a").attr("id") == 0)) {
  2039 + }
  2040 + else {
  2041 + var promise = ModuleService.getTermTextDataForPin($scope.moduleName)
  2042 + .then(
  2043 + function (response) {
  2044 + $scope.ListManagerTermInfo = response.data.Terms.Term;
  2045 + $rootScope.selectedSystemList = $('#termList option[id="' + id + '"]').text();
  2046 + $scope.selectedSystemPinDataForList = new jinqJs()
  2047 + .from($scope.ListManagerTermInfo)
  2048 + .where("__TermText == " + $('#termList option[id="' + id + '"]').text())
  2049 + .select();
  2050 + $scope.showSelectedSystemPins($scope.selectedSystemPinDataForList[0].__BodySystemId);
  2051 + },
  2052 + function (error) {
  2053 + // handle errors here
  2054 + console.log(' error: ' + error.statusText);
  2055 + }
  2056 + )
  2057 + }
  2058 +
  2059 + });
  2060 + }
2029 2061  
  2062 +
  2063 +
  2064 + //get data from pindata for this trem
  2065 +
2030 2066 var pinDataForTerm = new jinqJs()
2031 2067 .from($scope.aaPinData)
2032 2068 .where("_TermId == " + $scope.searchItemId)
2033 2069 .select();
  2070 + $timeout(function () {
2034 2071 //make all pin heads grey
2035 2072 var radial = $('#aaDetailViewCanvas').createGradient({
2036 2073 x1: 50, y1: 50,
... ... @@ -2039,11 +2076,10 @@ function ($scope, $window, $rootScope, $compile, $http, $log, $location, $timeou
2039 2076 c1: 'rgba(100, 50, 0,0)',
2040 2077 c2: 'rgb(216, 216, 216)'
2041 2078 });
2042   -
2043   -
2044 2079 $('#aaDetailViewCanvas').setLayers({
2045 2080 fillStyle: radial,
2046 2081 }).drawLayers();
  2082 +
2047 2083 console.log(pinDataForTerm[0]._PinId);
2048 2084 $scope.clickedPins = [];
2049 2085 $scope.clickedPins.push({ 'id': pinDataForTerm[0]._PinId });
... ... @@ -2051,9 +2087,11 @@ function ($scope, $window, $rootScope, $compile, $http, $log, $location, $timeou
2051 2087 var pinID = "PinArc_" + pinDataForTerm[0]._PinId;
2052 2088 $scope.activePinArray.push({ 'id': pinID });
2053 2089 $scope.showAnnotation(pinDataForTerm, false, false, true);
2054   - // maintaing scroll position on selection of options in list manager.
  2090 + // maintaing scroll position on selection of options in list manager.
2055 2091 var annotationTopPos = $(".common-drag").css("top").split("p");
2056 2092 $("#canvasDiv").scrollTop(annotationTopPos[0]);
  2093 + }, 700);
  2094 +
2057 2095 $scope.IsSearchVisible = false;
2058 2096 }
2059 2097  
... ...