diff --git a/400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js b/400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js index 053ac63..9715be3 100644 --- a/400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js +++ b/400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js @@ -17,7 +17,7 @@ function ($scope,$rootScope, $compile,$http, $log, $location, $timeout,DA,Module //view specific constants $scope.voId ; $scope.layerNo; - + $scope.daCounter=1; //get the DA body view list based on selected gender @@ -87,7 +87,8 @@ function ($scope,$rootScope, $compile,$http, $log, $location, $timeout,DA,Module $scope.openView = function ($event) { // debugger; $rootScope.currentBodyViewId = $event.currentTarget.id; - $rootScope.currentActiveViewTitle = $event.currentTarget.textContent; + + $rootScope.ViewTitle = $event.currentTarget.textContent; var u = $location.url(); $location.url('/da-body-view'); @@ -140,7 +141,30 @@ function ($scope,$rootScope, $compile,$http, $log, $location, $timeout,DA,Module //da-body-view functions $scope.openBodyView = function () { - // debugger; + // debugger; + // $rootScope.jsPanelTitle = $rootScope.currentActiveViewTitle; + var openViews = new jinqJs() + .from($rootScope.openViews) + .where("BodyViewId==" + $rootScope.currentBodyViewId ) + .select(); + + var counter = 1; + + var tittle = $rootScope.ViewTitle; + if (openViews.length > 0) + { + angular.forEach(openViews, function (value, key) { + + if (value.BodyViews == tittle) { + tittle = $rootScope.ViewTitle + counter++; + $rootScope.currentActiveViewTitle = tittle; + } + + }); + } + + + $.jsPanel({ id: 'daImagePanel', //selector: '.daView', @@ -148,7 +172,7 @@ function ($scope,$rootScope, $compile,$http, $log, $location, $timeout,DA,Module ajax: { url: 'app/views/da/da-view.html' }, - title: $rootScope.currentActiveViewTitle, + title: tittle, // bootstrap: 'columns large-10 medium-9', position: { top: 70, //50, @@ -163,8 +187,17 @@ function ($scope,$rootScope, $compile,$http, $log, $location, $timeout,DA,Module }); $scope.LoadDefaultLayerImage(); - $rootScope.openViewsDA.push({ "ViewId": 1 }); - + // $rootScope.openViewsDA.push({ "ViewId": 1 }); + $rootScope.currentSlug = 'da-body-view'; + + + + $rootScope.openViews.push( + { + "module": $rootScope.currentActiveModuleTitle, "BodyView": $rootScope.currentActiveViewTitle, "state": max,"BodyViewId": $rootScope.currentBodyViewId, + "slug": $rootScope.currentSlug + } + ); } angular.element(document).ready(function () { @@ -740,13 +773,36 @@ function ($scope,$rootScope, $compile,$http, $log, $location, $timeout,DA,Module } + //called on jspanel close $scope.openParent = function () { - + debugger; + var openViews = $rootScope.openViews; + if (openViews.length > 0) { + $rootScope.openViews.splice(openViews.length - 1); + } + if (openViews.length > 0) { + var lastOpenMoudle = $rootScope.openViews[openViews.length - 1]; + } $('#daImagePanel').remove(); $location.url('/da-view-list'); } + //called on jsanel minimize + $scope.setState = function (state,title) { + + $rootScope.openViews = new jinqJs() + .from($rootScope.openViews) + .where("module == " + title) + .select(); + $rootScope.openViews.push( + { + "module": $rootScope.currentActiveModuleTitle, "BodyView":$rootScope.currentActiveViewTitle, "state": state, + "slug": $rootScope.currentSlug + } + ); + + } diff --git a/400-SOURCECODE/AIAHTML5.Web/app/controllers/HomeController.js b/400-SOURCECODE/AIAHTML5.Web/app/controllers/HomeController.js index a0f9825..ecc25e3 100644 --- a/400-SOURCECODE/AIAHTML5.Web/app/controllers/HomeController.js +++ b/400-SOURCECODE/AIAHTML5.Web/app/controllers/HomeController.js @@ -10,7 +10,10 @@ AIA.controller("HomeController", ["$rootScope","Modules", "$log", "$location", " $rootScope.currentBodyViewId = 1; $rootScope.currentActiveModuleTitle = 'Welcome to A.D.A.M. Interactive Anatomy';//Modules[0].Name; $rootScope.currentActiveViewTitle; + $rootScope.cuurentActiveModuleId; $rootScope.openModules = []; - $rootScope.openViewsDA = []; + $rootScope.openViews = []; + $rootScope.currentSlug; + $rootScope.jsPanelTitle; }] ); \ No newline at end of file diff --git a/400-SOURCECODE/AIAHTML5.Web/app/views/da/da-body-view-list.html b/400-SOURCECODE/AIAHTML5.Web/app/views/da/da-body-view-list.html index 340388e..0a953a8 100644 --- a/400-SOURCECODE/AIAHTML5.Web/app/views/da/da-body-view-list.html +++ b/400-SOURCECODE/AIAHTML5.Web/app/views/da/da-body-view-list.html @@ -1,4 +1,4 @@ -