diff --git a/400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js b/400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js index c10ff73..3892982 100644 --- a/400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js +++ b/400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js @@ -7692,205 +7692,211 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l } $scope.OnViewChange = function (event) { + // alert(event.target.title); + // alert($("[title*='" + event.target.title + "']").parent().hasClass("active")); + if ($("[title*='" + event.target.title + "']").parent().hasClass("active") == true) { - var canvasDiv = document.getElementById('canvasDiv'); - $scope.imageVerticalScrollPosition = canvasDiv.scrollTop; - $scope.imageHorizontlScrollPosition = canvasDiv.scrollLeft; + - $("#btnExtract").removeClass("disabled"); - $("#btnTranparency").removeClass("disabled"); - $rootScope.isTransparencyBoxActivated = false; - $rootScope.isNormalMode = false; + } + else { + var canvasDiv = document.getElementById('canvasDiv'); + $scope.imageVerticalScrollPosition = canvasDiv.scrollTop; + $scope.imageHorizontlScrollPosition = canvasDiv.scrollLeft; - //close transparency box - $scope.CloseTransparencyBox(); + $("#btnExtract").removeClass("disabled"); + $("#btnTranparency").removeClass("disabled"); + $rootScope.isTransparencyBoxActivated = false; + $rootScope.isNormalMode = false; - //if listanager is visisble then close it + //close transparency box + $scope.CloseTransparencyBox(); - //$rootScope.isListManagerSelected = false; - $rootScope.CloseListManager(); + //if listanager is visisble then close it - //to get the body system highlighted on view change. commented the below line - // $rootScope.isHighlightBodyByBodySystem = false; + //$rootScope.isListManagerSelected = false; + $rootScope.CloseListManager(); - //Remove the search list and then Repopulate it on change of View - $('#searchListDiv').empty() - if ($rootScope.openViews.length > 0) { - $rootScope.openViews.splice($rootScope.openViews.length - 1); - } + //to get the body system highlighted on view change. commented the below line + // $rootScope.isHighlightBodyByBodySystem = false; - $rootScope.isViewChange = true; + //Remove the search list and then Repopulate it on change of View + $('#searchListDiv').empty() + if ($rootScope.openViews.length > 0) { + $rootScope.openViews.splice($rootScope.openViews.length - 1); + } - if ($rootScope.isExtract == true) { - $rootScope.isExtract = false; - $rootScope.isHighLight = true; - $("#btnExtract").removeClass("btn-primary"); - $("#btnExtract").addClass("btn-black"); - $("#btnHighLight").removeClass("btn-black"); - $("#btnHighLight").addClass("btn-primary"); - } + $rootScope.isViewChange = true; - $scope.layerNumber = 0; + if ($rootScope.isExtract == true) { + $rootScope.isExtract = false; + $rootScope.isHighLight = true; + $("#btnExtract").removeClass("btn-primary"); + $("#btnExtract").addClass("btn-black"); + $("#btnHighLight").removeClass("btn-black"); + $("#btnHighLight").addClass("btn-primary"); + } - //remove existing body view - var canDiv = document.getElementById('canvasDiv'); - var canDivChildCount = canDiv.childElementCount; - if (canDivChildCount > 0) { - canDiv.innerHTML = ''; - } + $scope.layerNumber = 0; - var selectedViewId = $scope.bodyViews[event.currentTarget.title]; - $rootScope.viewOrientationId = selectedViewId; + //remove existing body view + var canDiv = document.getElementById('canvasDiv'); + var canDivChildCount = canDiv.childElementCount; + if (canDivChildCount > 0) { + canDiv.innerHTML = ''; + } - if ($rootScope.getLocalStorageValue("genderId") == 'Male') { - if ($rootScope.voId != selectedViewId) { - if (selectedViewId == 5) { - $rootScope.voId = 9; - } - else if (selectedViewId == 6) { - $rootScope.voId = 10; - } - else - $rootScope.voId = selectedViewId; - $rootScope.isLoading = true; + var selectedViewId = $scope.bodyViews[event.currentTarget.title]; + $rootScope.viewOrientationId = selectedViewId; - $rootScope.isLoading = true; - $('#spinner').css('visibility', 'visible'); + if ($rootScope.getLocalStorageValue("genderId") == 'Male') { + if ($rootScope.voId != selectedViewId) { + if (selectedViewId == 5) { + $rootScope.voId = 9; + } + else if (selectedViewId == 6) { + $rootScope.voId = 10; + } + else + $rootScope.voId = selectedViewId; + $rootScope.isLoading = true; - //1. first update the currentbodyviewid in local storage - localStorage.setItem("currentBodyViewId", $rootScope.voId); + $rootScope.isLoading = true; + $('#spinner').css('visibility', 'visible'); + //1. first update the currentbodyviewid in local storage + localStorage.setItem("currentBodyViewId", $rootScope.voId); - //2. Load selected body view - $scope.loadSelectedBodyView($rootScope.voId); - //3. load corresponding navigator man - $scope.loadNavigatorForSelectedBodyView($rootScope.voId); + //2. Load selected body view + $scope.loadSelectedBodyView($rootScope.voId); - //4. change the search terms as per the selected bodyview - $rootScope.loadSearchData(); + //3. load corresponding navigator man + $scope.loadNavigatorForSelectedBodyView($rootScope.voId); - //5.Change the popup title next to search - $scope.currentTitleFromJson = $rootScope.getLocalStorageValue("currentViewTitle"); + //4. change the search terms as per the selected bodyview + $rootScope.loadSearchData(); - }; + //5.Change the popup title next to search + $scope.currentTitleFromJson = $rootScope.getLocalStorageValue("currentViewTitle"); + }; - //set selected view name as the title of jspanel - // $('#daImagePanel')[0].childNodes[0].childNodes[0].innerHTML = $rootScope.getLocalStorageValue("genderId") +" "+ event.currentTarget.attributes[1].value; - } - else { - if (selectedViewId == 5) { - selectedViewId = 11; - } - else if (selectedViewId == 6) { - selectedViewId = 12; + //set selected view name as the title of jspanel + // $('#daImagePanel')[0].childNodes[0].childNodes[0].innerHTML = $rootScope.getLocalStorageValue("genderId") +" "+ event.currentTarget.attributes[1].value; + } - else - selectedViewId = $scope.correspondingBodyViewIds[selectedViewId];; - if ($rootScope.voId != selectedViewId) { - $rootScope.voId = selectedViewId; - $rootScope.isLoading = true; + else { + if (selectedViewId == 5) { + selectedViewId = 11; + } + else if (selectedViewId == 6) { + selectedViewId = 12; + } + else + selectedViewId = $scope.correspondingBodyViewIds[selectedViewId];; + if ($rootScope.voId != selectedViewId) { + $rootScope.voId = selectedViewId; + $rootScope.isLoading = true; - $rootScope.isLoading = true; - $('#spinner').css('visibility', 'visible'); + $rootScope.isLoading = true; + $('#spinner').css('visibility', 'visible'); + //1. + $scope.loadSelectedBodyView($rootScope.voId); - localStorage.setItem("currentBodyViewId", $rootScope.voId); - //1. - $scope.loadSelectedBodyView($rootScope.voId); + //2. + $scope.loadNavigatorForSelectedBodyView($rootScope.voId); + //3. load corresponding navigator man + $scope.loadNavigatorForSelectedBodyView($rootScope.voId); - //2. - $scope.loadNavigatorForSelectedBodyView($rootScope.voId); - //3. load corresponding navigator man - $scope.loadNavigatorForSelectedBodyView($rootScope.voId); + //4. change the search terms as per the selected bodyview + $rootScope.loadSearchData(); - //4. change the search terms as per the selected bodyview - $rootScope.loadSearchData(); + //5.Change the popup title next to search + $scope.currentTitleFromJson = $rootScope.getLocalStorageValue("currentViewTitle"); + }; - //5.Change the popup title next to search - $scope.currentTitleFromJson = $rootScope.getLocalStorageValue("currentViewTitle"); - }; + // $('#daImagePanel')[0].childNodes[0].childNodes[0].innerHTML = $rootScope.getLocalStorageValue("genderId") + " " + $scope.bodyViews[event.currentTarget.attributes[1].value; - // $('#daImagePanel')[0].childNodes[0].childNodes[0].innerHTML = $rootScope.getLocalStorageValue("genderId") + " " + $scope.bodyViews[event.currentTarget.attributes[1].value; + } + $('#daImagePanel')[0].childNodes[0].childNodes[0].innerHTML = $rootScope.getLocalStorageValue("genderId") + " " + event.currentTarget.title; + localStorage.setItem("currentViewTitle", $rootScope.getLocalStorageValue("genderId") + " " + event.currentTarget.title); + localStorage.setItem("currentBodyViewId", selectedViewId); - } - $('#daImagePanel')[0].childNodes[0].childNodes[0].innerHTML = $rootScope.getLocalStorageValue("genderId") + " " + event.currentTarget.title; - localStorage.setItem("currentViewTitle", $rootScope.getLocalStorageValue("genderId") + " " + event.currentTarget.title); - localStorage.setItem("currentBodyViewId", selectedViewId); + $rootScope.openViews.push( + { + "module": $rootScope.currentActiveModuleTitle, "bodyView": $rootScope.getLocalStorageValue("currentViewTitle"), "state": 'max', "BodyViewId": $rootScope.voId, + "slug": $rootScope.currentSlug + } + ); - $rootScope.openViews.push( - { - "module": $rootScope.currentActiveModuleTitle, "bodyView": $rootScope.getLocalStorageValue("currentViewTitle"), "state": 'max', "BodyViewId": $rootScope.voId, - "slug": $rootScope.currentSlug - } - ); + var viewtarget = angular.element(event.currentTarget); + var title_drop_view = viewtarget.attr('title'); - var viewtarget = angular.element(event.currentTarget); - var title_drop_view = viewtarget.attr('title'); + if (title_drop_view == "Anterior") { - if (title_drop_view == "Anterior") { + $scope.AnteriorView = "active"; + $scope.LateralView = ""; + $scope.MedialView = ""; + $scope.PosteriorView = ""; + $scope.LateralArmView = ""; + $scope.MedialArmView = ""; - $scope.AnteriorView = "active"; - $scope.LateralView = ""; - $scope.MedialView = ""; - $scope.PosteriorView = ""; - $scope.LateralArmView = ""; - $scope.MedialArmView = ""; + } + else if (title_drop_view == "Lateral") { - } - else if (title_drop_view == "Lateral") { + $scope.AnteriorView = ""; + $scope.LateralView = "active"; + $scope.MedialView = ""; + $scope.PosteriorView = ""; + $scope.LateralArmView = ""; + $scope.MedialArmView = ""; + } + else if (title_drop_view == "Medial") { - $scope.AnteriorView = ""; - $scope.LateralView = "active"; - $scope.MedialView = ""; - $scope.PosteriorView = ""; - $scope.LateralArmView = ""; - $scope.MedialArmView = ""; - } - else if (title_drop_view == "Medial") { + $scope.AnteriorView = ""; + $scope.LateralView = ""; + $scope.MedialView = "active"; + $scope.PosteriorView = ""; + $scope.LateralArmView = ""; + $scope.MedialArmView = ""; + } + else if (title_drop_view == "Posterior") { - $scope.AnteriorView = ""; - $scope.LateralView = ""; - $scope.MedialView = "active"; - $scope.PosteriorView = ""; - $scope.LateralArmView = ""; - $scope.MedialArmView = ""; - } - else if (title_drop_view == "Posterior") { + $scope.AnteriorView = ""; + $scope.LateralView = ""; + $scope.MedialView = ""; + $scope.PosteriorView = "active"; + $scope.LateralArmView = ""; + $scope.MedialArmView = ""; + } + else if (title_drop_view == "Lateral Arm") { - $scope.AnteriorView = ""; - $scope.LateralView = ""; - $scope.MedialView = ""; - $scope.PosteriorView = "active"; - $scope.LateralArmView = ""; - $scope.MedialArmView = ""; - } - else if (title_drop_view == "Lateral Arm") { + $scope.AnteriorView = ""; + $scope.LateralView = ""; + $scope.MedialView = ""; + $scope.PosteriorView = ""; + $scope.LateralArmView = "active"; + $scope.MedialArmView = ""; + } + else if (title_drop_view == "Medial Arm") { - $scope.AnteriorView = ""; - $scope.LateralView = ""; - $scope.MedialView = ""; - $scope.PosteriorView = ""; - $scope.LateralArmView = "active"; - $scope.MedialArmView = ""; + $scope.AnteriorView = ""; + $scope.LateralView = ""; + $scope.MedialView = ""; + $scope.PosteriorView = ""; + $scope.LateralArmView = ""; + $scope.MedialArmView = "active"; + } + //13573 : DA > Annotations should not be display if we change the body view. + $rootScope.CloseAnnotationTool(); + $scope.searchFilter = ''; } - else if (title_drop_view == "Medial Arm") { - $scope.AnteriorView = ""; - $scope.LateralView = ""; - $scope.MedialView = ""; - $scope.PosteriorView = ""; - $scope.LateralArmView = ""; - $scope.MedialArmView = "active"; - } - //13573 : DA > Annotations should not be display if we change the body view. - $rootScope.CloseAnnotationTool(); - $scope.searchFilter = ''; } - //Reload DA controller event listener after setting change $scope.$on('reloadDAControllerEvent', function (event, data) { console.log('reloadDAControllerEvent');