Commit acff4858a6ec343ae78c2d5af5be8aefc99985ce

Authored by Nikita Kulshreshtha
2 parents 9109ad92 008ca6c7

Merge branch 'AAShowSelecetdPins1' into Develop

400-SOURCECODE/AIAHTML5.Web/app/controllers/TileViewListController.js
... ... @@ -25,6 +25,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
25 25 $scope.AllImageType = [];
26 26 $rootScope.speechBubbleDimaensions = [];
27 27 $scope.runningSearchWorkers = [];
  28 + $scope.clickedPins = [];
28 29  
29 30 $scope.query = {
30 31 selectedbodyregion: '',
... ... @@ -436,13 +437,17 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
436 437  
437 438 $scope.showSelectedSystemPins = function (event) {
438 439  
  440 + $rootScope.isLoading = true;
  441 + $('#spinner').css('visibility', 'visible');
  442 +
439 443 $scope.removeSpeechBubble();
440 444 if (event.currentTarget.id == "0") {
441 445  
442 446 $scope.selectedSystemName = null;
443 447 if ($scope.isHidePinBtnClicked) {
444 448  
445   - $scope.showAllPinsAfterHide($scope.aaPinData);
  449 + // $scope.showAllPinsAfterHide($scope.aaPinData);
  450 + $scope.showAllPinsAfterHide();
446 451 }
447 452 else {
448 453 $scope.showAllPins();
... ... @@ -468,7 +473,8 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
468 473 .where("_BodySystemName == " + $scope.selectedSystemName)
469 474 .select();
470 475 if ($scope.isHidePinBtnClicked) {
471   - $scope.showAllPinsAfterHide($scope.selectedSystemPinData);
  476 + // $scope.showAllPinsAfterHide($scope.selectedSystemPinData);
  477 + $scope.showAllPinsAfterHide();
472 478  
473 479 }
474 480 else
... ... @@ -571,6 +577,8 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
571 577  
572 578 }
573 579  
  580 + $rootScope.isLoading = false;
  581 + $('#spinner').css('visibility', 'hidden');
574 582 // $scope.MultiLanguageAnnationArray.push($rootScope.annotationText[i])
575 583 }
576 584  
... ... @@ -911,7 +919,31 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
911 919 var pinID = (clickedPin.name).substring(7, (clickedPin.name).length);
912 920 // alert('pinId: ' + pinID);
913 921 //showAnnotation();
914   - var pinID = (clickedPin.name).substring(7, (clickedPin.name).length);
  922 +
  923 + var pinData = new jinqJs()
  924 + .from($scope.aaPinData)
  925 + .where("_PinId == " + pinID)
  926 + .select();
  927 +
  928 +
  929 + var pinTermNumber = pinData[0]._TermId;
  930 +
  931 + var pinWithSameTerm = new jinqJs()
  932 +
  933 + .from($scope.aaPinData)
  934 + .where("_TermId == " + pinTermNumber)
  935 + .select();
  936 +
  937 +
  938 + if (pinWithSameTerm != undefined && pinWithSameTerm != null && pinWithSameTerm.length > 0) {
  939 +
  940 + for (var i = 0; i < pinWithSameTerm.length; i++) {
  941 +
  942 + $scope.clickedPins.push({ 'id': pinWithSameTerm[i]._PinId })
  943 + }
  944 +
  945 + }
  946 +
915 947 var selectedPinData = new jinqJs()
916 948 .from($scope.aaPinData)
917 949 .where("_PinId == " + pinID)
... ... @@ -1046,6 +1078,9 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
1046 1078  
1047 1079 $scope.hidePins = function () {
1048 1080  
  1081 + $rootScope.isLoading = true;
  1082 + $('#spinner').css('visibility', 'visible');
  1083 +
1049 1084 $scope.hideSpeechBubble();
1050 1085  
1051 1086 $scope.isHidePinBtnClicked = true;
... ... @@ -1063,50 +1098,102 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
1063 1098 }).drawLayers();
1064 1099 })
1065 1100  
  1101 + $rootScope.isLoading = false;
  1102 + $('#spinner').css('visibility', 'hidden');
1066 1103 }
1067 1104  
1068   - $scope.showAllPinsAfterHide = function (selectedSystemPinData) {
  1105 + $scope.showAllPinsAfterHide = function (event) {
  1106 +
  1107 + $rootScope.isLoading = true;
  1108 + $('#spinner').css('visibility', 'visible');
  1109 +
1069 1110  
1070 1111 $scope.isHidePinBtnClicked = false;
  1112 +
1071 1113 if ($scope.selectedSystemName != null && $scope.selectedSystemName != undefined) {
1072   - $scope.showSystemPins($scope.selectedSystemPinData);
  1114 +
  1115 + $scope.showSystemPins($scope.selectedSystemPinData, false);
  1116 +
1073 1117 } else {
1074   - $scope.showSystemPins($scope.aaPinData);
1075 1118  
1076   - //angular.forEach($scope.aaPinData, function (aaPinDataValue, aaPinDataKey) {
  1119 + $scope.showSystemPins($scope.aaPinData, false);
  1120 + }
  1121 + $scope.showSpeechBubble();
  1122 + };
  1123 +
  1124 +
  1125 + $scope.showSelectedPins = function () {
1077 1126  
1078   - // var pinName = 'Pin_' + aaPinDataValue._PinId;
1079   - // var pinArcName = 'PinArc_' + aaPinDataValue._PinId;
  1127 + $rootScope.isLoading = true;
  1128 + $('#spinner').css('visibility', 'visible');
1080 1129  
1081   - // $('#aaDetailViewCanvas').setLayer(pinName, {
1082   - // visible: true // set to true instead to show the layer again
1083   - // }).drawLayers();
  1130 + $scope.isHidePinBtnClicked = false;
  1131 +
  1132 + if ($scope.selectedSystemName != null && $scope.selectedSystemName != undefined) {
  1133 +
  1134 + $scope.showSystemPins($scope.selectedSystemPinData, true);
  1135 +
  1136 + }
  1137 + else {
  1138 + $scope.showSystemPins($scope.aaPinData, true);
1084 1139  
1085   - // $('#aaDetailViewCanvas').setLayer(pinArcName, {
1086   - // visible: true // set to true instead to show the layer again
1087   - // }).drawLayers();
1088   - //})
1089 1140 }
1090 1141 $scope.showSpeechBubble();
1091 1142 };
1092 1143  
1093   - $scope.showSystemPins = function (seletedSystemPinData) {
  1144 +
  1145 + $scope.showSystemPins = function (seletedSystemPinData, isShowSelectedPins) {
1094 1146  
1095   - angular.forEach(seletedSystemPinData, function (aaPinDataValue, aaPinDataKey) {
  1147 + if (isShowSelectedPins) {
1096 1148  
1097   - var pinName = 'Pin_' + aaPinDataValue._PinId;
1098   - var pinArcName = 'PinArc_' + aaPinDataValue._PinId;
  1149 + angular.forEach($scope.clickedPins, function (value, key) {
1099 1150  
1100   - $('#aaDetailViewCanvas').setLayer(pinName, {
1101   - visible: true // set to true instead to show the layer again
1102   - }).drawLayers();
  1151 + seletedSystemPinData = new jinqJs()
  1152 + .from(seletedSystemPinData)
  1153 + .where('_PinId != ' + value.id)
  1154 + .select();
  1155 + })
  1156 + angular.forEach(seletedSystemPinData, function (aaPinDataValue, aaPinDataKey) {
1103 1157  
1104   - $('#aaDetailViewCanvas').setLayer(pinArcName, {
1105   - visible: true // set to true instead to show the layer again
1106   - }).drawLayers();
1107   - })
1108   - }
  1158 + // if (aaPinDataValue._PinId != value.id) {
  1159 + var pinName = 'Pin_' + aaPinDataValue._PinId;
  1160 + var pinArcName = 'PinArc_' + aaPinDataValue._PinId;
  1161 +
  1162 + $('#aaDetailViewCanvas').setLayer(pinName, {
  1163 + visible: false // set to true instead to show the layer again
  1164 + }).drawLayers();
1109 1165  
  1166 + $('#aaDetailViewCanvas').setLayer(pinArcName, {
  1167 + visible: false // set to true instead to show the layer again
  1168 + }).drawLayers();
  1169 + // }
  1170 + })
  1171 +
  1172 + // })
  1173 + $scope.clickedPins = [];
  1174 + }
  1175 +
  1176 + else {
  1177 + angular.forEach(seletedSystemPinData, function (aaPinDataValue, aaPinDataKey) {
  1178 +
  1179 + var pinName = 'Pin_' + aaPinDataValue._PinId;
  1180 + var pinArcName = 'PinArc_' + aaPinDataValue._PinId;
  1181 +
  1182 + $('#aaDetailViewCanvas').setLayer(pinName, {
  1183 + visible: true // set to true instead to show the layer again
  1184 + }).drawLayers();
  1185 +
  1186 + $('#aaDetailViewCanvas').setLayer(pinArcName, {
  1187 + visible: true // set to true instead to show the layer again
  1188 + }).drawLayers();
  1189 + })
  1190 + }
  1191 +
  1192 + $rootScope.isLoading = false;
  1193 + $('#spinner').css('visibility', 'hidden');
  1194 +
  1195 +
  1196 + }
1110 1197  
1111 1198 $scope.showItemsForSearch = function () {
1112 1199 console.log('showItemsForSearch is called');
... ... @@ -1225,3 +1312,12 @@ function onSearchItemSelection(event) {
1225 1312 scope.highlightPinBasedOnSerachItem(event);
1226 1313 });
1227 1314 }
  1315 +
  1316 +function showSelectedPins(event) {
  1317 +
  1318 + console.log('showSelectedPins is called')
  1319 + var scope = angular.element(document.getElementById("aaDetailPageDiv")).scope();
  1320 + scope.$apply(function () {
  1321 + scope.showSelectedPins(event);
  1322 + });
  1323 +}
1228 1324 \ No newline at end of file
... ...
400-SOURCECODE/AIAHTML5.Web/app/views/aa/atlas-anatomy-detail.html
... ... @@ -30,7 +30,7 @@
30 30 <div class="toggle-icon toggleBar toggleHeadingButton" data-toggle="tooltip" data-placement="top" title="Show/Hide Sidebar"></div>
31 31 <div class="">
32 32 <div class="col-sm-6" title="Hide Pins"><button onclick="hidePins(event)" class="btn btn-black btn-sm" > <img src="../../../content/images/aa/LeftMenu/hide-pin.png" alt="" title=""></button> </div>
33   - <div class="col-sm-6" title="Show Selected Pins"><button class="btn btn-black btn-sm pull-right"><img src="../../../content/images/aa/LeftMenu/draw-pin.png" alt="" title=""></button></div>
  33 + <div class="col-sm-6" title="Show Selected Pins"><button class="btn btn-black btn-sm pull-right" onclick="showSelectedPins(event)"><img src="../../../content/images/aa/LeftMenu/draw-pin.png" alt="" title=""></button></div>
34 34 <div class="col-sm-6" title="Show All Pins in System(s)"><button class="btn btn-primary btn-sm marginTop5" onclick="showAllPins(event)"><img src="../../../content/images/aa/LeftMenu/all-pin.png" alt="" title=""></button></div>
35 35 <div class="col-sm-6" title="Select System">
36 36 <button class="btn btn-black btn-sm pull-right marginTop5 dropdown-toggle" type="button" id="dropdownMenu221" data-toggle="dropdown" aria-haspopup="true" aria-expanded="true"><img src="../../../content/images/aa/LeftMenu/icon-highlight.png" alt="" title=""></button>
... ...