Commit 1b04fbe3273c29ad0e991cbf51c8c05d5749d600
1 parent
3efba58c
21215 : Atlas Anatomy > Pins appear on the Body System even when both Hide Pins …
…and Show All Pins In System(s) are un-select.
Showing
1 changed file
with
128 additions
and
38 deletions
400-SOURCECODE/AIAHTML5.Web/app/controllers/TileViewListController.js
... | ... | @@ -345,8 +345,8 @@ function ($scope, $window, $rootScope, $compile, $http, $log, $location, $timeou |
345 | 345 | |
346 | 346 | $scope.showAllPins = function () { |
347 | 347 | |
348 | + $scope.allPinDataArray = []; | |
348 | 349 | var promise = ModuleService.getPinDataForImage($rootScope.imageName) |
349 | - | |
350 | 350 | .then( |
351 | 351 | function (result) { |
352 | 352 | |
... | ... | @@ -366,7 +366,7 @@ function ($scope, $window, $rootScope, $compile, $http, $log, $location, $timeou |
366 | 366 | if ($scope.aaPinData != null && $scope.aaPinData.length > 0) { |
367 | 367 | |
368 | 368 | angular.forEach($scope.aaPinData, function (value, key) { |
369 | - | |
369 | + $scope.allPinDataArray.push(value._PinId); | |
370 | 370 | $scope.drawStaticPinsOnImage('aaDetailViewCanvas', value._PinId, value._PinX, value._PinY, value._HeadX, value._HeadY) |
371 | 371 | }) |
372 | 372 | |
... | ... | @@ -392,7 +392,7 @@ function ($scope, $window, $rootScope, $compile, $http, $log, $location, $timeou |
392 | 392 | |
393 | 393 | |
394 | 394 | $scope.FilterByImage = function (moduleId, query) { |
395 | - //alert(JSON.stringify(query)); | |
395 | + | |
396 | 396 | $scope.moduleId = moduleId; |
397 | 397 | |
398 | 398 | console.log('loadForModuleById is called') |
... | ... | @@ -591,7 +591,7 @@ function ($scope, $window, $rootScope, $compile, $http, $log, $location, $timeou |
591 | 591 | } |
592 | 592 | |
593 | 593 | $scope.showSelectedSystemPins = function (event) { |
594 | - | |
594 | + | |
595 | 595 | $rootScope.isLoading = true; |
596 | 596 | $('#spinner').css('visibility', 'visible'); |
597 | 597 | |
... | ... | @@ -642,7 +642,7 @@ function ($scope, $window, $rootScope, $compile, $http, $log, $location, $timeou |
642 | 642 | |
643 | 643 | angular.forEach($scope.selectedSystemPinData, function (value, key) { |
644 | 644 | |
645 | - | |
645 | + | |
646 | 646 | $scope.drawStaticPinsOnImage('aaDetailViewCanvas', value._PinId, value._PinX, value._PinY, value._HeadX, value._HeadY) |
647 | 647 | |
648 | 648 | }) |
... | ... | @@ -1373,7 +1373,7 @@ function ($scope, $window, $rootScope, $compile, $http, $log, $location, $timeou |
1373 | 1373 | } |
1374 | 1374 | |
1375 | 1375 | $scope.hidePins = function () { |
1376 | - | |
1376 | + | |
1377 | 1377 | $rootScope.isLoading = true; |
1378 | 1378 | $('#spinner').css('visibility', 'visible'); |
1379 | 1379 | |
... | ... | @@ -1402,8 +1402,7 @@ function ($scope, $window, $rootScope, $compile, $http, $log, $location, $timeou |
1402 | 1402 | } |
1403 | 1403 | |
1404 | 1404 | $scope.showAllPinsAfterHide = function (event) { |
1405 | - | |
1406 | - | |
1405 | + | |
1407 | 1406 | $rootScope.isLoading = true; |
1408 | 1407 | $('#spinner').css('visibility', 'visible'); |
1409 | 1408 | |
... | ... | @@ -1427,29 +1426,31 @@ function ($scope, $window, $rootScope, $compile, $http, $log, $location, $timeou |
1427 | 1426 | |
1428 | 1427 | $scope.showSelectedPins = function () { |
1429 | 1428 | |
1430 | - $rootScope.isLoading = true; | |
1431 | - $('#spinner').css('visibility', 'visible'); | |
1432 | - | |
1433 | - $scope.isHidePinBtnClicked = false; | |
1429 | + | |
1430 | + $rootScope.isLoading = true; | |
1431 | + $('#spinner').css('visibility', 'visible'); | |
1432 | + | |
1433 | + $scope.isHidePinBtnClicked = false; | |
1434 | 1434 | |
1435 | - if ($scope.selectedSystemName != null && $scope.selectedSystemName != undefined) { | |
1435 | + if ($scope.selectedSystemName != null && $scope.selectedSystemName != undefined) { | |
1436 | 1436 | |
1437 | - $scope.showSystemPins($scope.selectedSystemPinData, true); | |
1437 | + $scope.showSystemPins($scope.selectedSystemPinData, true); | |
1438 | 1438 | |
1439 | - } | |
1440 | - else { | |
1441 | - $scope.showSystemPins($scope.aaPinData, true); | |
1439 | + } | |
1440 | + else { | |
1441 | + $scope.showSystemPins($scope.aaPinData, true); | |
1442 | 1442 | |
1443 | - } | |
1444 | - $scope.showSpeechBubble(); | |
1445 | - $(".tooltip-custom").removeClass("btn-primary"); | |
1446 | - $(".tooltip-custom").addClass("btn-black"); | |
1447 | - $("#selectedPin").addClass("btn-primary"); | |
1443 | + } | |
1444 | + $scope.showSpeechBubble(); | |
1445 | + $(".tooltip-custom").removeClass("btn-primary"); | |
1446 | + $(".tooltip-custom").addClass("btn-black"); | |
1447 | + $("#selectedPin").addClass("btn-primary"); | |
1448 | + | |
1448 | 1449 | }; |
1449 | 1450 | |
1450 | 1451 | |
1451 | 1452 | $scope.showSystemPins = function (seletedSystemPinData, isShowSelectedPins) { |
1452 | - | |
1453 | + | |
1453 | 1454 | if (isShowSelectedPins) { |
1454 | 1455 | |
1455 | 1456 | angular.forEach($scope.clickedPins, function (value, key) { |
... | ... | @@ -1464,23 +1465,25 @@ function ($scope, $window, $rootScope, $compile, $http, $log, $location, $timeou |
1464 | 1465 | // if (aaPinDataValue._PinId != value.id) { |
1465 | 1466 | var pinName = 'Pin_' + value1.id; |
1466 | 1467 | var pinArcName = 'PinArc_' + value1.id; |
1468 | + | |
1469 | + | |
1470 | + $('#aaDetailViewCanvas').setLayer(pinName, { | |
1471 | + visible: true // set to true instead to show the layer again | |
1472 | + }).drawLayers(); | |
1467 | 1473 | |
1468 | - $('#aaDetailViewCanvas').setLayer(pinName, { | |
1469 | - visible: true // set to true instead to show the layer again | |
1470 | - }).drawLayers(); | |
1471 | - | |
1472 | - $('#aaDetailViewCanvas').setLayer(pinArcName, { | |
1473 | - visible: true // set to true instead to show the layer again | |
1474 | - }).drawLayers(); | |
1474 | + $('#aaDetailViewCanvas').setLayer(pinArcName, { | |
1475 | + visible: true // set to true instead to show the layer again | |
1476 | + }).drawLayers(); | |
1477 | + | |
1478 | + | |
1475 | 1479 | // } |
1476 | 1480 | }) |
1477 | 1481 | |
1478 | 1482 | angular.forEach(seletedSystemPinData, function (aaPinDataValue, aaPinDataKey) { |
1479 | 1483 | |
1480 | - // if (aaPinDataValue._PinId != value.id) { | |
1481 | 1484 | var pinName = 'Pin_' + aaPinDataValue._PinId; |
1482 | 1485 | var pinArcName = 'PinArc_' + aaPinDataValue._PinId; |
1483 | - | |
1486 | + | |
1484 | 1487 | $('#aaDetailViewCanvas').setLayer(pinName, { |
1485 | 1488 | visible: false // set to true instead to show the layer again |
1486 | 1489 | }).drawLayers(); |
... | ... | @@ -1488,11 +1491,10 @@ function ($scope, $window, $rootScope, $compile, $http, $log, $location, $timeou |
1488 | 1491 | $('#aaDetailViewCanvas').setLayer(pinArcName, { |
1489 | 1492 | visible: false // set to true instead to show the layer again |
1490 | 1493 | }).drawLayers(); |
1491 | - // } | |
1494 | + | |
1492 | 1495 | }) |
1493 | 1496 | |
1494 | - // }) | |
1495 | - // $scope.clickedPins = []; | |
1497 | + | |
1496 | 1498 | } |
1497 | 1499 | |
1498 | 1500 | else { |
... | ... | @@ -1624,6 +1626,7 @@ function ($scope, $window, $rootScope, $compile, $http, $log, $location, $timeou |
1624 | 1626 | } |
1625 | 1627 | } |
1626 | 1628 | $scope.activePinOnLayerChange = function () { |
1629 | + | |
1627 | 1630 | for (var i = 0; i <= $scope.activePinArray.length - 1; i++) { |
1628 | 1631 | var radialAfterClick = $('#aaDetailViewCanvas').createGradient({ |
1629 | 1632 | x1: 50, y1: 50, |
... | ... | @@ -1639,6 +1642,72 @@ function ($scope, $window, $rootScope, $compile, $http, $log, $location, $timeou |
1639 | 1642 | |
1640 | 1643 | } |
1641 | 1644 | } |
1645 | + | |
1646 | + | |
1647 | + $scope.activePinOnSliderChange = function () { | |
1648 | + if ($scope.activePinArray.length == 1) | |
1649 | + { | |
1650 | + for (var i = 0; i <= $scope.allPinDataArray.length - 1; i++) { | |
1651 | + var activeArc = $scope.activePinArray[0].split("_"); | |
1652 | + if ($scope.allPinDataArray[i] == activeArc[1]) { | |
1653 | + var pinName = 'Pin_' + $scope.allPinDataArray[i]; | |
1654 | + var pinArcName = 'PinArc_' + $scope.allPinDataArray[i]; | |
1655 | + $('#aaDetailViewCanvas').setLayer(pinName, { | |
1656 | + visible: true // set to true instead to show the layer again | |
1657 | + }).drawLayers(); | |
1658 | + $('#aaDetailViewCanvas').setLayer(pinArcName, { | |
1659 | + visible: true // set to true instead to show the layer again | |
1660 | + }).drawLayers(); | |
1661 | + } | |
1662 | + else { | |
1663 | + var pinName = 'Pin_' + $scope.allPinDataArray[i]; | |
1664 | + var pinArcName = 'PinArc_' + $scope.allPinDataArray[i]; | |
1665 | + $('#aaDetailViewCanvas').setLayer(pinName, { | |
1666 | + visible: false // set to true instead to show the layer again | |
1667 | + }).drawLayers(); | |
1668 | + $('#aaDetailViewCanvas').setLayer(pinArcName, { | |
1669 | + visible: false // set to true instead to show the layer again | |
1670 | + }).drawLayers(); | |
1671 | + } | |
1672 | + } | |
1673 | + } | |
1674 | + else { | |
1675 | + var seletedSystemPinData; | |
1676 | + angular.forEach($scope.activePinArray, function (value, key) { | |
1677 | + var pinID = value.split("_"); | |
1678 | + seletedSystemPinData = new jinqJs() | |
1679 | + .from($scope.allPinDataArray) | |
1680 | + .where('_PinId != ' + pinID[1]) | |
1681 | + .select(); | |
1682 | + }) | |
1683 | + | |
1684 | + angular.forEach(seletedSystemPinData, function (aaPinDataValue, aaPinDataKey) { | |
1685 | + | |
1686 | + var pinName = 'Pin_' + aaPinDataValue; | |
1687 | + var pinArcName = 'PinArc_' + aaPinDataValue; | |
1688 | + | |
1689 | + $('#aaDetailViewCanvas').setLayer(pinName, { | |
1690 | + visible: false // set to true instead to show the layer again | |
1691 | + }).drawLayers(); | |
1692 | + | |
1693 | + $('#aaDetailViewCanvas').setLayer(pinArcName, { | |
1694 | + visible: false // set to true instead to show the layer again | |
1695 | + }).drawLayers(); | |
1696 | + | |
1697 | + }) | |
1698 | + for (var i = 0; i <= $scope.activePinArray.length - 1; i++) { | |
1699 | + var pinName = $scope.activePinArray[i].split("_"); | |
1700 | + var activePinName = 'Pin_' + pinName[1]; | |
1701 | + var pinArcName = 'PinArc_' + pinName[1]; | |
1702 | + $('#aaDetailViewCanvas').setLayer(activePinName, { | |
1703 | + visible: true // set to true instead to show the layer again | |
1704 | + }).drawLayers(); | |
1705 | + $('#aaDetailViewCanvas').setLayer(pinArcName, { | |
1706 | + visible: true // set to true instead to show the layer again | |
1707 | + }).drawLayers(); | |
1708 | + } | |
1709 | + } | |
1710 | + } | |
1642 | 1711 | }]); |
1643 | 1712 | |
1644 | 1713 | |
... | ... | @@ -1851,9 +1920,30 @@ $(document).ready(function () { |
1851 | 1920 | scope.context = canvas.getContext("2d") |
1852 | 1921 | $("#modItemImage").attr('src', scope.OpenItemImagePath); |
1853 | 1922 | scope.isSliderChange = true; |
1854 | - | |
1855 | - scope.showAllPins(); | |
1856 | - | |
1923 | + var btnID = ''; | |
1924 | + $("div.tools div:eq(1) div").each(function () { | |
1925 | + if ($(this).find("button").hasClass("btn-primary")) { | |
1926 | + btnID = $(this).find("button").attr("id"); | |
1927 | + $('#' + btnID).removeClass("btn-black"); | |
1928 | + $('#' + btnID).addClass("btn-primary"); | |
1929 | + } | |
1930 | + }); | |
1931 | + switch (btnID) { | |
1932 | + | |
1933 | + case "hidePinBtn": | |
1934 | + | |
1935 | + break; | |
1936 | + case "allPinBtn": | |
1937 | + scope.showAllPins(); | |
1938 | + break; | |
1939 | + case "selectedPin": | |
1940 | + scope.showAllPins(); | |
1941 | + setTimeout(function () { | |
1942 | + console.log(scope.allPinDataArray); | |
1943 | + scope.activePinOnSliderChange(); | |
1944 | + }, 2000); | |
1945 | + break; | |
1946 | + } | |
1857 | 1947 | } |
1858 | 1948 | |
1859 | 1949 | }); | ... | ... |