Commit bad78cc8de69651fb24d1e2bffb7633106ae34e9
1 parent
bf0048e3
hide pins and show All/system pins functionality is implemented
Showing
2 changed files
with
144 additions
and
20 deletions
400-SOURCECODE/AIAHTML5.Web/app/controllers/TileViewListController.js
... | ... | @@ -434,13 +434,18 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo |
434 | 434 | $scope.removeSpeechBubble(); |
435 | 435 | if (event.currentTarget.id == "0") { |
436 | 436 | |
437 | - | |
438 | - $scope.showAllPins(); | |
437 | + $scope.selectedSystemName = null; | |
438 | + if ($scope.isHidePinBtnClicked) { | |
439 | 439 | |
440 | + $scope.showAllPinsAfterHide($scope.aaPinData); | |
441 | + } | |
442 | + else { | |
443 | + $scope.showAllPins(); | |
444 | + } | |
440 | 445 | } |
441 | 446 | else { |
442 | 447 | |
443 | - var selectedSystemName = event.currentTarget.title; | |
448 | + $scope.selectedSystemName = event.currentTarget.title; | |
444 | 449 | |
445 | 450 | |
446 | 451 | // get termText info |
... | ... | @@ -453,27 +458,34 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo |
453 | 458 | //on gettng all required data, draw pins |
454 | 459 | if ($scope.aaPinData != null && $scope.aaPinData.length > 0) { |
455 | 460 | |
456 | - var selectedSystemPinData = new jinqJs() | |
461 | + $scope.selectedSystemPinData = new jinqJs() | |
457 | 462 | .from($scope.aaPinData) |
458 | - .where("_BodySystemName == " + selectedSystemName) | |
463 | + .where("_BodySystemName == " + $scope.selectedSystemName) | |
459 | 464 | .select(); |
460 | - //remove other system pins | |
461 | - if (selectedSystemPinData != null && selectedSystemPinData.length > 0) { | |
465 | + if ($scope.isHidePinBtnClicked) { | |
466 | + $scope.showAllPinsAfterHide($scope.selectedSystemPinData); | |
467 | + | |
468 | + } | |
469 | + else | |
470 | + { | |
471 | + //remove other system pins | |
472 | + if ($scope.selectedSystemPinData != null && $scope.selectedSystemPinData.length > 0) { | |
462 | 473 | |
463 | - angular.forEach($scope.aaPinData, function (aaPinDataValue, aaPinDataKey) { | |
474 | + angular.forEach($scope.aaPinData, function (aaPinDataValue, aaPinDataKey) { | |
464 | 475 | |
465 | - if (aaPinDataValue._BodySystemName != selectedSystemName) | |
466 | - $scope.removePin('aaDetailViewCanvas', aaPinDataValue._PinId); | |
467 | - }) | |
476 | + if (aaPinDataValue._BodySystemName != $scope.selectedSystemName) | |
477 | + $scope.removePin('aaDetailViewCanvas', aaPinDataValue._PinId); | |
478 | + }) | |
468 | 479 | |
469 | - angular.forEach(selectedSystemPinData, function (value, key) { | |
480 | + angular.forEach($scope.selectedSystemPinData, function (value, key) { | |
470 | 481 | |
471 | 482 | |
472 | - $scope.drawStaticPinsOnImage('aaDetailViewCanvas', value._PinId, value._PinX, value._PinY, value._HeadX, value._HeadY) | |
483 | + $scope.drawStaticPinsOnImage('aaDetailViewCanvas', value._PinId, value._PinX, value._PinY, value._HeadX, value._HeadY) | |
473 | 484 | |
474 | - }) | |
475 | - //show annotation on first pin of the sysyem | |
476 | - $scope.showAnnotation(selectedSystemPinData, false, false); | |
485 | + }) | |
486 | + //show annotation on first pin of the sysyem | |
487 | + $scope.showAnnotation($scope.selectedSystemPinData, false, false); | |
488 | + } | |
477 | 489 | } |
478 | 490 | } |
479 | 491 | }, |
... | ... | @@ -602,6 +614,61 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo |
602 | 614 | } |
603 | 615 | }; |
604 | 616 | |
617 | + $scope.showSpeechBubble = function () { | |
618 | + | |
619 | + | |
620 | + //clear speech bubbles | |
621 | + var speechBubbles = $("div[id*='speechBubble']"); | |
622 | + if (speechBubbles != null || speechBubbles != undefined && speechBubbles.length > 0) { | |
623 | + for (var j = 0; j < speechBubbles.length; j++) { | |
624 | + | |
625 | + document.getElementById(speechBubbles[j].id).style.visibility = 'visible'; | |
626 | + } | |
627 | + } | |
628 | + var speechBubbleLines = $("div[id*='speechBubbleLine']"); | |
629 | + if (speechBubbleLines != null || speechBubbleLines != undefined && speechBubbleLines.length > 0) { | |
630 | + for (var j = 0; j < speechBubbleLines.length; j++) { | |
631 | + | |
632 | + document.getElementById(speechBubbleLines[j].id).style.visibility = 'visible'; | |
633 | + } | |
634 | + } | |
635 | + | |
636 | + var speechBubbleDraggedLines = $("div[id*='speechBubbleDraggedLine']"); | |
637 | + if (speechBubbleDraggedLines != null || speechBubbleDraggedLines != undefined && speechBubbleDraggedLines.length > 0) { | |
638 | + for (var j = 0; j < speechBubbleDraggedLines.length; j++) { | |
639 | + | |
640 | + document.getElementById(speechBubbleDraggedLines[j].id).style.visibility = 'visible'; | |
641 | + } | |
642 | + } | |
643 | + }; | |
644 | + | |
645 | + $scope.hideSpeechBubble = function () { | |
646 | + | |
647 | + | |
648 | + //clear speech bubbles | |
649 | + var speechBubbles = $("div[id*='speechBubble']"); | |
650 | + if (speechBubbles != null || speechBubbles != undefined && speechBubbles.length > 0) { | |
651 | + for (var j = 0; j < speechBubbles.length; j++) { | |
652 | + | |
653 | + document.getElementById(speechBubbles[j].id).style.visibility = 'hidden'; | |
654 | + } | |
655 | + } | |
656 | + var speechBubbleLines = $("div[id*='speechBubbleLine']"); | |
657 | + if (speechBubbleLines != null || speechBubbleLines != undefined && speechBubbleLines.length > 0) { | |
658 | + for (var j = 0; j < speechBubbleLines.length; j++) { | |
659 | + | |
660 | + document.getElementById(speechBubbleLines[j].id).style.visibility = 'hidden'; | |
661 | + } | |
662 | + } | |
663 | + | |
664 | + var speechBubbleDraggedLines = $("div[id*='speechBubbleDraggedLine']"); | |
665 | + if (speechBubbleDraggedLines != null || speechBubbleDraggedLines != undefined && speechBubbleDraggedLines.length > 0) { | |
666 | + for (var j = 0; j < speechBubbleDraggedLines.length; j++) { | |
667 | + | |
668 | + document.getElementById(speechBubbleDraggedLines[j].id).style.visibility = 'hidden'; | |
669 | + } | |
670 | + } | |
671 | + }; | |
605 | 672 | |
606 | 673 | |
607 | 674 | $scope.createSpeechBubble = function (x, y, PinId, isCtrlPressed, isPinClicked, isSameTermWithMultiPin) { |
... | ... | @@ -825,6 +892,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo |
825 | 892 | groups: ["Pin_" + PinId], |
826 | 893 | strokeStyle: 'black', |
827 | 894 | strokeWidth: 2, |
895 | + visible: true, | |
828 | 896 | x1: offsetX1, y1: offsetY1, |
829 | 897 | x2: x, y2: y, |
830 | 898 | |
... | ... | @@ -834,6 +902,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo |
834 | 902 | groups: ["Pin_" + PinId], |
835 | 903 | strokeStyle: 'grey', |
836 | 904 | strokeWidth: 2, |
905 | + visible: true, | |
837 | 906 | fillStyle: radial, |
838 | 907 | x: x, y: y, |
839 | 908 | radius: 5, |
... | ... | @@ -951,7 +1020,10 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo |
951 | 1020 | |
952 | 1021 | |
953 | 1022 | $scope.hidePins = function () { |
954 | - debugger; | |
1023 | + | |
1024 | + $scope.hideSpeechBubble(); | |
1025 | + | |
1026 | + $scope.isHidePinBtnClicked = true; | |
955 | 1027 | angular.forEach($scope.aaPinData, function (aaPinDataValue, aaPinDataKey) { |
956 | 1028 | |
957 | 1029 | var pinName = 'Pin_' + aaPinDataValue._PinId; |
... | ... | @@ -967,6 +1039,48 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo |
967 | 1039 | }) |
968 | 1040 | |
969 | 1041 | } |
1042 | + | |
1043 | + $scope.showAllPinsAfterHide = function (selectedSystemPinData) { | |
1044 | + | |
1045 | + $scope.isHidePinBtnClicked = false; | |
1046 | + if ($scope.selectedSystemName != null && $scope.selectedSystemName != undefined) { | |
1047 | + $scope.showSystemPins($scope.selectedSystemPinData); | |
1048 | + } else { | |
1049 | + $scope.showSystemPins($scope.aaPinData); | |
1050 | + | |
1051 | + //angular.forEach($scope.aaPinData, function (aaPinDataValue, aaPinDataKey) { | |
1052 | + | |
1053 | + // var pinName = 'Pin_' + aaPinDataValue._PinId; | |
1054 | + // var pinArcName = 'PinArc_' + aaPinDataValue._PinId; | |
1055 | + | |
1056 | + // $('#aaDetailViewCanvas').setLayer(pinName, { | |
1057 | + // visible: true // set to true instead to show the layer again | |
1058 | + // }).drawLayers(); | |
1059 | + | |
1060 | + // $('#aaDetailViewCanvas').setLayer(pinArcName, { | |
1061 | + // visible: true // set to true instead to show the layer again | |
1062 | + // }).drawLayers(); | |
1063 | + //}) | |
1064 | + } | |
1065 | + $scope.showSpeechBubble(); | |
1066 | + }; | |
1067 | + | |
1068 | + $scope.showSystemPins = function (seletedSystemPinData) { | |
1069 | + | |
1070 | + angular.forEach(seletedSystemPinData, function (aaPinDataValue, aaPinDataKey) { | |
1071 | + | |
1072 | + var pinName = 'Pin_' + aaPinDataValue._PinId; | |
1073 | + var pinArcName = 'PinArc_' + aaPinDataValue._PinId; | |
1074 | + | |
1075 | + $('#aaDetailViewCanvas').setLayer(pinName, { | |
1076 | + visible: true // set to true instead to show the layer again | |
1077 | + }).drawLayers(); | |
1078 | + | |
1079 | + $('#aaDetailViewCanvas').setLayer(pinArcName, { | |
1080 | + visible: true // set to true instead to show the layer again | |
1081 | + }).drawLayers(); | |
1082 | + }) | |
1083 | + } | |
970 | 1084 | }]); |
971 | 1085 | |
972 | 1086 | function showSelectedSystemPins(event) { |
... | ... | @@ -976,9 +1090,19 @@ function showSelectedSystemPins(event) { |
976 | 1090 | scope.showSelectedSystemPins(event); |
977 | 1091 | }); |
978 | 1092 | } |
979 | -hidePins = function (event) { | |
1093 | + | |
1094 | +function hidePins(event) { | |
1095 | + | |
980 | 1096 | var scope = angular.element(document.getElementById("aaDetailPageDiv")).scope(); |
981 | 1097 | scope.$apply(function () { |
982 | 1098 | scope.hidePins(event); |
983 | 1099 | }); |
1100 | +} | |
1101 | + | |
1102 | +function showAllPins(event) { | |
1103 | + | |
1104 | + var scope = angular.element(document.getElementById("aaDetailPageDiv")).scope(); | |
1105 | + scope.$apply(function () { | |
1106 | + scope.showAllPinsAfterHide(event); | |
1107 | + }); | |
984 | 1108 | } |
985 | 1109 | \ No newline at end of file | ... | ... |
400-SOURCECODE/AIAHTML5.Web/app/views/aa/atlas-anatomy-detail.html
... | ... | @@ -29,9 +29,9 @@ |
29 | 29 | <div class="tools pull-left" style="top:44px;"> |
30 | 30 | <div class="toggle-icon toggleBar toggleHeadingButton" data-toggle="tooltip" data-placement="top" title="Show/Hide Sidebar"></div> |
31 | 31 | <div class=""> |
32 | - <div class="col-sm-6" title="Hide Pins"><button onclick="hidePins()" class="btn btn-black btn-sm" > <img src="../../../content/images/aa/LeftMenu/hide-pin.png" alt="" title=""></button> </div> | |
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 | 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> |
34 | - <div class="col-sm-6" title="Show All Pins in System(s)"><button class="btn btn-primary btn-sm marginTop5"><img src="../../../content/images/aa/LeftMenu/all-pin.png" alt="" title=""></button></div> | |
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> |
37 | 37 | ... | ... |