From 3def4dc698b3b9ded9440a6a09641f6056cb7654 Mon Sep 17 00:00:00 2001 From: nikita Date: Fri, 22 Apr 2016 18:17:24 +0530 Subject: [PATCH] introduced code for open multiple view. saving view info in array. --- 400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js | 70 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++------- 400-SOURCECODE/AIAHTML5.Web/app/controllers/HomeController.js | 5 ++++- 400-SOURCECODE/AIAHTML5.Web/app/views/da/da-body-view-list.html | 2 +- 400-SOURCECODE/AIAHTML5.Web/index.html | 8 ++++---- 400-SOURCECODE/AIAHTML5.Web/libs/jquery/jquery_plugin/jsPanel/jspanel/jquery.jspanel.css | 2 +- 400-SOURCECODE/AIAHTML5.Web/libs/jquery/jquery_plugin/jsPanel/jspanel/jquery.jspanel.js | 9 +++++++++ 6 files changed, 82 insertions(+), 14 deletions(-) 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 @@ -
+
diff --git a/400-SOURCECODE/AIAHTML5.Web/index.html b/400-SOURCECODE/AIAHTML5.Web/index.html index 7fe9b3a..596383f 100644 --- a/400-SOURCECODE/AIAHTML5.Web/index.html +++ b/400-SOURCECODE/AIAHTML5.Web/index.html @@ -47,11 +47,11 @@
-
- - +
+ +
- +
> diff --git a/400-SOURCECODE/AIAHTML5.Web/libs/jquery/jquery_plugin/jsPanel/jspanel/jquery.jspanel.css b/400-SOURCECODE/AIAHTML5.Web/libs/jquery/jquery_plugin/jsPanel/jspanel/jquery.jspanel.css index 4a45962..c3abb3b 100644 --- a/400-SOURCECODE/AIAHTML5.Web/libs/jquery/jquery_plugin/jsPanel/jspanel/jquery.jspanel.css +++ b/400-SOURCECODE/AIAHTML5.Web/libs/jquery/jquery_plugin/jsPanel/jspanel/jquery.jspanel.css @@ -129,7 +129,7 @@ h3.jsPanel-title{ overflow: hidden; text-align: left; text-overflow: ellipsis; - margin: 10px; + margin: 0 5px; font-variant: normal; font-weight: bold; cursor: move; diff --git a/400-SOURCECODE/AIAHTML5.Web/libs/jquery/jquery_plugin/jsPanel/jspanel/jquery.jspanel.js b/400-SOURCECODE/AIAHTML5.Web/libs/jquery/jquery_plugin/jsPanel/jspanel/jquery.jspanel.js index 88e653b..0ef7b22 100644 --- a/400-SOURCECODE/AIAHTML5.Web/libs/jquery/jquery_plugin/jsPanel/jspanel/jquery.jspanel.js +++ b/400-SOURCECODE/AIAHTML5.Web/libs/jquery/jquery_plugin/jsPanel/jspanel/jquery.jspanel.js @@ -1632,14 +1632,23 @@ console.log("jsPanel version: " + jsPanel.version); // jsPanel minimize $('.jsPanel-btn-min', jsP).on('click', function (e) { + alert('minimized') e.preventDefault(); jsPanel.minimize(jsP); + + var $scope = jsPanel.getScope('DAController'); + $scope.setState('min',jsPanel.header.title); + $scope.$apply(); }); // jsPanel maximize $('.jsPanel-btn-max', jsP).on('click', function (e) { e.preventDefault(); jsPanel.maximize(jsP); + + var $scope = jsPanel.getScope('DAController'); + $scope.setState('max', jsPanel.header.title); + $scope.$apply(); }); // jsPanel normalize -- libgit2 0.21.4