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