diff --git a/400-SOURCECODE/AIAHTML5.Web/app/controllers/TileViewListController.js b/400-SOURCECODE/AIAHTML5.Web/app/controllers/TileViewListController.js index 2af5199..3fd1d84 100644 --- a/400-SOURCECODE/AIAHTML5.Web/app/controllers/TileViewListController.js +++ b/400-SOURCECODE/AIAHTML5.Web/app/controllers/TileViewListController.js @@ -25,7 +25,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo $scope.AllImageType = []; $rootScope.speechBubbleDimaensions = []; $scope.runningSearchWorkers = []; - + $scope.clickedPins = []; $scope.query = { selectedbodyregion: '', selectedbodysystem: '', @@ -442,7 +442,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo $scope.selectedSystemName = null; if ($scope.isHidePinBtnClicked) { - $scope.showAllPinsAfterHide($scope.aaPinData); + $scope.showAllPinsAfterHide(); } else { $scope.showAllPins(); @@ -468,7 +468,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo .where("_BodySystemName == " + $scope.selectedSystemName) .select(); if ($scope.isHidePinBtnClicked) { - $scope.showAllPinsAfterHide($scope.selectedSystemPinData); + $scope.showAllPinsAfterHide(); } else @@ -897,6 +897,8 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo click: function (clickedPin) { + + //change the head color to green var radialAfterClick = $('#aaDetailViewCanvas').createGradient({ x1: 50, y1: 50, @@ -912,6 +914,27 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo // alert('pinId: ' + pinID); //showAnnotation(); var pinID = (clickedPin.name).substring(7, (clickedPin.name).length); + + + var pinData = new jinqJs() + .from($scope.aaPinData) + .where("_PinId == " + pinID) + .select(); + + var pinTermNumber = pinData[0]._TermId; + + var pinWithSameTerm = new jinqJs() + .from($scope.aaPinData) + .where("_TermId == " + pinTermNumber) + .select(); + + if (pinWithSameTerm != undefined && pinWithSameTerm != null && pinWithSameTerm.length > 0) { + for (var i = 0; i < pinWithSameTerm.length; i++) { + $scope.clickedPins.push({ 'id': pinWithSameTerm[i]._PinId }) + } + } + // $scope.clickedPins.push({ 'id': pinID }); + var selectedPinData = new jinqJs() .from($scope.aaPinData) .where("_PinId == " + pinID) @@ -1065,46 +1088,74 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo } - $scope.showAllPinsAfterHide = function (selectedSystemPinData) { + $scope.showAllPinsAfterHide = function (event) { $scope.isHidePinBtnClicked = false; if ($scope.selectedSystemName != null && $scope.selectedSystemName != undefined) { - $scope.showSystemPins($scope.selectedSystemPinData); + $scope.showSystemPins($scope.selectedSystemPinData, false); } else { - $scope.showSystemPins($scope.aaPinData); + $scope.showSystemPins($scope.aaPinData, false); - //angular.forEach($scope.aaPinData, function (aaPinDataValue, aaPinDataKey) { + } + $scope.showSpeechBubble(); + }; - // var pinName = 'Pin_' + aaPinDataValue._PinId; - // var pinArcName = 'PinArc_' + aaPinDataValue._PinId; - // $('#aaDetailViewCanvas').setLayer(pinName, { - // visible: true // set to true instead to show the layer again - // }).drawLayers(); + $scope.showSelectedPins = function () { + + $scope.isHidePinBtnClicked = false; + if ($scope.selectedSystemName != null && $scope.selectedSystemName != undefined) { + $scope.showSystemPins($scope.selectedSystemPinData,true); + } else { + $scope.showSystemPins($scope.aaPinData,true); - // $('#aaDetailViewCanvas').setLayer(pinArcName, { - // visible: true // set to true instead to show the layer again - // }).drawLayers(); - //}) } $scope.showSpeechBubble(); }; - $scope.showSystemPins = function (seletedSystemPinData) { - angular.forEach(seletedSystemPinData, function (aaPinDataValue, aaPinDataKey) { + $scope.showSystemPins = function (seletedSystemPinData, isShowSelectedPins) { - var pinName = 'Pin_' + aaPinDataValue._PinId; - var pinArcName = 'PinArc_' + aaPinDataValue._PinId; + if (isShowSelectedPins) { - $('#aaDetailViewCanvas').setLayer(pinName, { - visible: true // set to true instead to show the layer again - }).drawLayers(); + angular.forEach($scope.clickedPins, function (value, key) { + - $('#aaDetailViewCanvas').setLayer(pinArcName, { - visible: true // set to true instead to show the layer again - }).drawLayers(); - }) + angular.forEach(seletedSystemPinData, function (aaPinDataValue, aaPinDataKey) { + + if (aaPinDataValue._PinId != value.id) { + var pinName = 'Pin_' + aaPinDataValue._PinId; + var pinArcName = 'PinArc_' + aaPinDataValue._PinId; + + $('#aaDetailViewCanvas').setLayer(pinName, { + visible: false // set to true instead to show the layer again + }).drawLayers(); + + $('#aaDetailViewCanvas').setLayer(pinArcName, { + visible: false // set to true instead to show the layer again + }).drawLayers(); + } + }) + + }) + $scope.clickedPins = []; + } + + else { + angular.forEach(seletedSystemPinData, function (aaPinDataValue, aaPinDataKey) { + + var pinName = 'Pin_' + aaPinDataValue._PinId; + var pinArcName = 'PinArc_' + aaPinDataValue._PinId; + + $('#aaDetailViewCanvas').setLayer(pinName, { + visible: true // set to true instead to show the layer again + }).drawLayers(); + + $('#aaDetailViewCanvas').setLayer(pinArcName, { + visible: true // set to true instead to show the layer again + }).drawLayers(); + }) + } } @@ -1258,3 +1309,12 @@ function onSearchItemSelection(event) { scope.highlightPinBasedOnSerachItem(event); }); } + +function showSelectedPins(event) { + alert('showSelectedPins') + console.log('showSelectedPins is called') + var scope = angular.element(document.getElementById("aaDetailPageDiv")).scope(); + scope.$apply(function () { + scope.showSelectedPins(event); + }); +} diff --git a/400-SOURCECODE/AIAHTML5.Web/app/views/aa/atlas-anatomy-detail.html b/400-SOURCECODE/AIAHTML5.Web/app/views/aa/atlas-anatomy-detail.html index 7b31e87..adb58c7 100644 --- a/400-SOURCECODE/AIAHTML5.Web/app/views/aa/atlas-anatomy-detail.html +++ b/400-SOURCECODE/AIAHTML5.Web/app/views/aa/atlas-anatomy-detail.html @@ -30,7 +30,7 @@