diff --git a/400-SOURCECODE/AIAHTML5.Web/app/controllers/HomeController.js b/400-SOURCECODE/AIAHTML5.Web/app/controllers/HomeController.js index 747507a..bf65cbf 100644 --- a/400-SOURCECODE/AIAHTML5.Web/app/controllers/HomeController.js +++ b/400-SOURCECODE/AIAHTML5.Web/app/controllers/HomeController.js @@ -198,6 +198,9 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data var homepath = $rootScope.homeURL; $("#HomeContainerDiv").css({ "display": "none", "pointer-events": "none", "opacity": ".5" }); $(".navbar-fixed-top").css({"display": "none", "pointer-events": "none", "opacity": ".5" }); + // if any panel in minimized mode + $("#jsPanel-min-container").css({"display":"none"}); + var parentslag = ""; var openNewlink = ""; @@ -319,7 +322,7 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data //$('#' + elmnt.id).trigger('click'); sessionStorage.setItem('isModuleOpenByOpenResource', 'true'); sessionStorage.removeItem('ExitsCBFileDetail'); - + OpenDefaultModule(iframe); }, 500); @@ -341,11 +344,7 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data $rootScope.isCallFromOtherModule = true; - if ($location.url() == "/curriculum-builder-detail") { - window.parent.AIAModuleOpenResoureInCB(newWindowData); - } - else - { + if ($location.url() != "/curriculum-builder-detail") { var newwindowNo = 0; var ExistData = ModuleService.getModuleData(newWindowData.mType); @@ -359,23 +358,51 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data } ModuleService.setModuleData(newWindowData, newwindowNo); - $scope.loadOpenResourceWindow(newWindowData.mType); + } + + if ($location.url() == "/curriculum-builder-detail") { + + window.parent.AIAModuleOpenResoureInCB(newWindowData); + } + else if (($location.url() == "/da-body-view")) { + + $scope.loadOpenResourceWindow(newWindowData.mType, '#daBodyview'); + } + else if ($location.url() == "/clinical-illustrations-detail") { + $scope.loadOpenResourceWindow(newWindowData.mType, '#CIView'); + } + else if ($location.url() == "/module-item-view") { + + $scope.loadOpenResourceWindow(newWindowData.mType, '#aaBodyView'); + } + else if ($location.url() == "/clinical-animations-detail") { + $scope.loadOpenResourceWindow(newWindowData.mType, '#CAView'); + } + else if ($location.url() == "/adam-images-detail") { + $scope.loadOpenResourceWindow(newWindowData.mType, '#AIView'); + } + else if ($location.url() == "/3d-anatomy-details") { + + $scope.loadOpenResourceWindow(newWindowData.mType, '#ThreeDView'); + } + else if ($location.url() == "/lab-exercise-view") { + + $scope.loadOpenResourceWindow(newWindowData.mType, '#labBodyview'); } }, 500); } - - $scope.loadOpenResourceWindow = function (moduleName) + $scope.loadOpenResourceWindow = function (moduleName,BasemoduleDivId) { switch (moduleName) { case "DISSECTIBLE_ANATOMY": - var daSectionExist = document.getElementById('daOpenModuleDiv'); + var daSectionExist = document.getElementById('daCustomModuleDiv'); - if (daSectionExist == null) { - $("#HomeContainerDiv").append($('
')); - var html = $('#daOpenModuleDiv').append(""); + if (daSectionExist == null && BasemoduleDivId != "#daBodyview") { + $(BasemoduleDivId).append($('
')); + var html = $('#daCustomModuleDiv').append(""); $compile(html)($scope); } else { @@ -384,11 +411,11 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data } break; case "ATLAS_ANATOMY": - var aaSectionExist = document.getElementById('aaOpenModuleDiv'); + var aaSectionExist = document.getElementById('aaCustomModuleDiv'); - if (aaSectionExist == null) { - $("#HomeContainerDiv").append($('
')); - var html = $('#aaOpenModuleDiv').append(""); + if (aaSectionExist == null && BasemoduleDivId != "#aaBodyView") { + $(BasemoduleDivId).append($('
')); + var html = $('#aaCustomModuleDiv').append(""); $compile(html)($scope); } else { @@ -397,11 +424,11 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data } break; case "CLINICAL_ILLUSTRATIONS": - var ciSectionExist = document.getElementById('ciOpenModuleDiv'); + var ciSectionExist = document.getElementById('ciCustomModuleDiv'); - if (ciSectionExist == null) { - $("#HomeContainerDiv").append($('
')); - var html = $('#ciOpenModuleDiv').append(""); + if (ciSectionExist == null && BasemoduleDivId != "#CIView") { + $(BasemoduleDivId).append($('
')); + var html = $('#ciCustomModuleDiv').append(""); $compile(html)($scope); } else { @@ -410,11 +437,11 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data } break; case "ADAM_IMAGES": - var aiSectionExist = document.getElementById('aiOpenModuleDiv'); + var aiSectionExist = document.getElementById('aiCustomModuleDiv'); - if (aiSectionExist == null) { - $("#HomeContainerDiv").append($('
')); - var html = $('#aiOpenModuleDiv').append(""); + if (aiSectionExist == null && BasemoduleDivId != "#AIView") { + $(BasemoduleDivId).append($('
')); + var html = $('#aiCustomModuleDiv').append(""); $compile(html)($scope); } else { @@ -423,11 +450,11 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data } break; case "CLINICAL_ANIMATIONS": - var caSectionExist = document.getElementById('caOpenModuleDiv'); + var caSectionExist = document.getElementById('caCustomModuleDiv'); - if (caSectionExist == null) { - $("#HomeContainerDiv").append($('
')); - var html = $('#caOpenModuleDiv').append(""); + if (caSectionExist == null && BasemoduleDivId != "#CAView") { + $(BasemoduleDivId).append($('
')); + var html = $('#caCustomModuleDiv').append(""); $compile(html)($scope); } else { @@ -436,11 +463,11 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data } break; case "THREE_D_ANATOMY": - var threeDSectionExist = document.getElementById('theeDOpenModuleDiv'); + var threeDSectionExist = document.getElementById('theeDCustomModuleDiv'); - if (threeDSectionExist == null) { - $("#HomeContainerDiv").append($('
')); - var html = $('#theeDOpenModuleDiv').append(""); + if (threeDSectionExist == null && BasemoduleDivId != "#ThreeDView") { + $(BasemoduleDivId).append($('
')); + var html = $('#theeDCustomModuleDiv').append(""); $compile(html)($scope); } else { @@ -450,11 +477,11 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data break; case "LAB_EXERCISE": - var labSectionExist = document.getElementById('labOpenModuleDiv'); + var labSectionExist = document.getElementById('labCustomModuleDiv'); - if (labSectionExist == null) { - $("#HomeContainerDiv").append($('
')); - var html = $('#labOpenModuleDiv').append(""); + if (labSectionExist == null && BasemoduleDivId != "#labBodyview") { + $(BasemoduleDivId).append($('
')); + var html = $('#labCustomModuleDiv').append(""); $compile(html)($scope); } else { @@ -464,11 +491,11 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data break; case "MY_PICTURES": - var picSectionExist = document.getElementById('picOpenModuleDiv'); + var picSectionExist = document.getElementById('picCustomModuleDiv'); - if (picSectionExist == null) { - $("#HomeContainerDiv").append($('
')); - var html = $('#picOpenModuleDiv').append(""); + if (picSectionExist == null ||picSectionExist==undefined) { + $(BasemoduleDivId).append($('
')); + var html = $('#picCustomModuleDiv').append(""); $compile(html)($scope); } else { @@ -2109,7 +2136,9 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data if (index == 0) { var panel1 = document.getElementById(moduleImagePanel[index].id); - $("#" + panel1.id).css("top", firsttopPosition + 'px'); + if (!$(panel1).hasClass("jsPanel-state-minimized")) { + $("#" + panel1.id).css("top", firsttopPosition + 'px'); + } } else { @@ -2117,7 +2146,10 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data var lastTop = prevpanel.offsetTop + prevpanel.offsetHeight + 10; var lastpanel = document.getElementById(moduleImagePanel[index].id); - $("#" + lastpanel.id).css("top", lastTop + 'px'); + if (!$(lastpanel).hasClass("jsPanel-state-minimized")) { + $("#" + lastpanel.id).css("top", lastTop + 'px'); + } + } //Reset menu option like list manager,annotation when close module @@ -7114,6 +7146,7 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data $('#dvOpenResourcePanel').remove(); sessionStorage.removeItem('isModuleOpenByOpenResource'); + $("#jsPanel-min-container").removeAttr("style"); }); $rootScope.restrictBodySystemList = function () { @@ -7389,6 +7422,7 @@ function closeIFrame() { function AIAModuleOpenResourceInfo(windowData) { sessionStorage.removeItem('isModuleOpenByOpenResource'); window.parent.closeIFrame(); + $("#jsPanel-min-container").removeAttr("style"); var scope = angular.element(document.querySelector('[ng-controller="HomeController"]')).scope(); scope.$apply(function () { scope.AIAModuleOpenResourceInfo(windowData);