From 1b04fbe3273c29ad0e991cbf51c8c05d5749d600 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 30 Aug 2017 13:17:57 +0530 Subject: [PATCH] 21215 : Atlas Anatomy > Pins appear on the Body System even when both Hide Pins and Show All Pins In System(s) are un-select. --- 400-SOURCECODE/AIAHTML5.Web/app/controllers/TileViewListController.js | 166 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-------------------------------------- 1 file changed, 128 insertions(+), 38 deletions(-) diff --git a/400-SOURCECODE/AIAHTML5.Web/app/controllers/TileViewListController.js b/400-SOURCECODE/AIAHTML5.Web/app/controllers/TileViewListController.js index 6f16da1..2a464e9 100644 --- a/400-SOURCECODE/AIAHTML5.Web/app/controllers/TileViewListController.js +++ b/400-SOURCECODE/AIAHTML5.Web/app/controllers/TileViewListController.js @@ -345,8 +345,8 @@ function ($scope, $window, $rootScope, $compile, $http, $log, $location, $timeou $scope.showAllPins = function () { + $scope.allPinDataArray = []; var promise = ModuleService.getPinDataForImage($rootScope.imageName) - .then( function (result) { @@ -366,7 +366,7 @@ function ($scope, $window, $rootScope, $compile, $http, $log, $location, $timeou if ($scope.aaPinData != null && $scope.aaPinData.length > 0) { angular.forEach($scope.aaPinData, function (value, key) { - + $scope.allPinDataArray.push(value._PinId); $scope.drawStaticPinsOnImage('aaDetailViewCanvas', value._PinId, value._PinX, value._PinY, value._HeadX, value._HeadY) }) @@ -392,7 +392,7 @@ function ($scope, $window, $rootScope, $compile, $http, $log, $location, $timeou $scope.FilterByImage = function (moduleId, query) { - //alert(JSON.stringify(query)); + $scope.moduleId = moduleId; console.log('loadForModuleById is called') @@ -591,7 +591,7 @@ function ($scope, $window, $rootScope, $compile, $http, $log, $location, $timeou } $scope.showSelectedSystemPins = function (event) { - + $rootScope.isLoading = true; $('#spinner').css('visibility', 'visible'); @@ -642,7 +642,7 @@ function ($scope, $window, $rootScope, $compile, $http, $log, $location, $timeou angular.forEach($scope.selectedSystemPinData, function (value, key) { - + $scope.drawStaticPinsOnImage('aaDetailViewCanvas', value._PinId, value._PinX, value._PinY, value._HeadX, value._HeadY) }) @@ -1373,7 +1373,7 @@ function ($scope, $window, $rootScope, $compile, $http, $log, $location, $timeou } $scope.hidePins = function () { - + $rootScope.isLoading = true; $('#spinner').css('visibility', 'visible'); @@ -1402,8 +1402,7 @@ function ($scope, $window, $rootScope, $compile, $http, $log, $location, $timeou } $scope.showAllPinsAfterHide = function (event) { - - + $rootScope.isLoading = true; $('#spinner').css('visibility', 'visible'); @@ -1427,29 +1426,31 @@ function ($scope, $window, $rootScope, $compile, $http, $log, $location, $timeou $scope.showSelectedPins = function () { - $rootScope.isLoading = true; - $('#spinner').css('visibility', 'visible'); - - $scope.isHidePinBtnClicked = false; + + $rootScope.isLoading = true; + $('#spinner').css('visibility', 'visible'); + + $scope.isHidePinBtnClicked = false; - if ($scope.selectedSystemName != null && $scope.selectedSystemName != undefined) { + if ($scope.selectedSystemName != null && $scope.selectedSystemName != undefined) { - $scope.showSystemPins($scope.selectedSystemPinData, true); + $scope.showSystemPins($scope.selectedSystemPinData, true); - } - else { - $scope.showSystemPins($scope.aaPinData, true); + } + else { + $scope.showSystemPins($scope.aaPinData, true); - } - $scope.showSpeechBubble(); - $(".tooltip-custom").removeClass("btn-primary"); - $(".tooltip-custom").addClass("btn-black"); - $("#selectedPin").addClass("btn-primary"); + } + $scope.showSpeechBubble(); + $(".tooltip-custom").removeClass("btn-primary"); + $(".tooltip-custom").addClass("btn-black"); + $("#selectedPin").addClass("btn-primary"); + }; $scope.showSystemPins = function (seletedSystemPinData, isShowSelectedPins) { - + if (isShowSelectedPins) { angular.forEach($scope.clickedPins, function (value, key) { @@ -1464,23 +1465,25 @@ function ($scope, $window, $rootScope, $compile, $http, $log, $location, $timeou // if (aaPinDataValue._PinId != value.id) { var pinName = 'Pin_' + value1.id; var pinArcName = 'PinArc_' + value1.id; + + + $('#aaDetailViewCanvas').setLayer(pinName, { + visible: true // set to true instead to show the layer again + }).drawLayers(); - $('#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(); + $('#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(); @@ -1488,11 +1491,10 @@ function ($scope, $window, $rootScope, $compile, $http, $log, $location, $timeou $('#aaDetailViewCanvas').setLayer(pinArcName, { visible: false // set to true instead to show the layer again }).drawLayers(); - // } + }) - // }) - // $scope.clickedPins = []; + } else { @@ -1624,6 +1626,7 @@ function ($scope, $window, $rootScope, $compile, $http, $log, $location, $timeou } } $scope.activePinOnLayerChange = function () { + for (var i = 0; i <= $scope.activePinArray.length - 1; i++) { var radialAfterClick = $('#aaDetailViewCanvas').createGradient({ x1: 50, y1: 50, @@ -1639,6 +1642,72 @@ function ($scope, $window, $rootScope, $compile, $http, $log, $location, $timeou } } + + + $scope.activePinOnSliderChange = function () { + if ($scope.activePinArray.length == 1) + { + for (var i = 0; i <= $scope.allPinDataArray.length - 1; i++) { + var activeArc = $scope.activePinArray[0].split("_"); + if ($scope.allPinDataArray[i] == activeArc[1]) { + var pinName = 'Pin_' + $scope.allPinDataArray[i]; + var pinArcName = 'PinArc_' + $scope.allPinDataArray[i]; + $('#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(); + } + else { + var pinName = 'Pin_' + $scope.allPinDataArray[i]; + var pinArcName = 'PinArc_' + $scope.allPinDataArray[i]; + $('#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(); + } + } + } + else { + var seletedSystemPinData; + angular.forEach($scope.activePinArray, function (value, key) { + var pinID = value.split("_"); + seletedSystemPinData = new jinqJs() + .from($scope.allPinDataArray) + .where('_PinId != ' + pinID[1]) + .select(); + }) + + angular.forEach(seletedSystemPinData, function (aaPinDataValue, aaPinDataKey) { + + var pinName = 'Pin_' + aaPinDataValue; + var pinArcName = 'PinArc_' + aaPinDataValue; + + $('#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(); + + }) + for (var i = 0; i <= $scope.activePinArray.length - 1; i++) { + var pinName = $scope.activePinArray[i].split("_"); + var activePinName = 'Pin_' + pinName[1]; + var pinArcName = 'PinArc_' + pinName[1]; + $('#aaDetailViewCanvas').setLayer(activePinName, { + 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(); + } + } + } }]); @@ -1851,9 +1920,30 @@ $(document).ready(function () { scope.context = canvas.getContext("2d") $("#modItemImage").attr('src', scope.OpenItemImagePath); scope.isSliderChange = true; - - scope.showAllPins(); - + var btnID = ''; + $("div.tools div:eq(1) div").each(function () { + if ($(this).find("button").hasClass("btn-primary")) { + btnID = $(this).find("button").attr("id"); + $('#' + btnID).removeClass("btn-black"); + $('#' + btnID).addClass("btn-primary"); + } + }); + switch (btnID) { + + case "hidePinBtn": + + break; + case "allPinBtn": + scope.showAllPins(); + break; + case "selectedPin": + scope.showAllPins(); + setTimeout(function () { + console.log(scope.allPinDataArray); + scope.activePinOnSliderChange(); + }, 2000); + break; + } } }); -- libgit2 0.21.4