Commit 3def4dc698b3b9ded9440a6a09641f6056cb7654

Authored by Nikita Kulshreshtha
1 parent c6320ad6

introduced code for open multiple view. saving view info in array.

400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js
... ... @@ -17,7 +17,7 @@ function ($scope,$rootScope, $compile,$http, $log, $location, $timeout,DA,Module
17 17 //view specific constants
18 18 $scope.voId ;
19 19 $scope.layerNo;
20   -
  20 + $scope.daCounter=1;
21 21  
22 22  
23 23 //get the DA body view list based on selected gender
... ... @@ -87,7 +87,8 @@ function ($scope,$rootScope, $compile,$http, $log, $location, $timeout,DA,Module
87 87 $scope.openView = function ($event) {
88 88 // debugger;
89 89 $rootScope.currentBodyViewId = $event.currentTarget.id;
90   - $rootScope.currentActiveViewTitle = $event.currentTarget.textContent;
  90 +
  91 + $rootScope.ViewTitle = $event.currentTarget.textContent;
91 92 var u = $location.url();
92 93 $location.url('/da-body-view');
93 94  
... ... @@ -140,7 +141,30 @@ function ($scope,$rootScope, $compile,$http, $log, $location, $timeout,DA,Module
140 141 //da-body-view functions
141 142  
142 143 $scope.openBodyView = function () {
143   - // debugger;
  144 + // debugger;
  145 + // $rootScope.jsPanelTitle = $rootScope.currentActiveViewTitle;
  146 + var openViews = new jinqJs()
  147 + .from($rootScope.openViews)
  148 + .where("BodyViewId==" + $rootScope.currentBodyViewId )
  149 + .select();
  150 +
  151 + var counter = 1;
  152 +
  153 + var tittle = $rootScope.ViewTitle;
  154 + if (openViews.length > 0)
  155 + {
  156 + angular.forEach(openViews, function (value, key) {
  157 +
  158 + if (value.BodyViews == tittle) {
  159 + tittle = $rootScope.ViewTitle + counter++;
  160 + $rootScope.currentActiveViewTitle = tittle;
  161 + }
  162 +
  163 + });
  164 + }
  165 +
  166 +
  167 +
144 168 $.jsPanel({
145 169 id: 'daImagePanel',
146 170 //selector: '.daView',
... ... @@ -148,7 +172,7 @@ function ($scope,$rootScope, $compile,$http, $log, $location, $timeout,DA,Module
148 172 ajax: {
149 173 url: 'app/views/da/da-view.html'
150 174 },
151   - title: $rootScope.currentActiveViewTitle,
  175 + title: tittle,
152 176 // bootstrap: 'columns large-10 medium-9',
153 177 position: {
154 178 top: 70, //50,
... ... @@ -163,8 +187,17 @@ function ($scope,$rootScope, $compile,$http, $log, $location, $timeout,DA,Module
163 187 });
164 188  
165 189 $scope.LoadDefaultLayerImage();
166   - $rootScope.openViewsDA.push({ "ViewId": 1 });
167   -
  190 + // $rootScope.openViewsDA.push({ "ViewId": 1 });
  191 + $rootScope.currentSlug = 'da-body-view';
  192 +
  193 +
  194 +
  195 + $rootScope.openViews.push(
  196 + {
  197 + "module": $rootScope.currentActiveModuleTitle, "BodyView": $rootScope.currentActiveViewTitle, "state": max,"BodyViewId": $rootScope.currentBodyViewId,
  198 + "slug": $rootScope.currentSlug
  199 + }
  200 + );
168 201 }
169 202  
170 203 angular.element(document).ready(function () {
... ... @@ -740,13 +773,36 @@ function ($scope,$rootScope, $compile,$http, $log, $location, $timeout,DA,Module
740 773 }
741 774  
742 775  
  776 + //called on jspanel close
743 777 $scope.openParent = function () {
744   -
  778 + debugger;
  779 + var openViews = $rootScope.openViews;
  780 + if (openViews.length > 0) {
  781 + $rootScope.openViews.splice(openViews.length - 1);
  782 + }
  783 + if (openViews.length > 0) {
  784 + var lastOpenMoudle = $rootScope.openViews[openViews.length - 1];
  785 + }
745 786 $('#daImagePanel').remove();
746 787 $location.url('/da-view-list');
747 788 }
748 789  
  790 + //called on jsanel minimize
  791 + $scope.setState = function (state,title) {
  792 +
  793 + $rootScope.openViews = new jinqJs()
  794 + .from($rootScope.openViews)
  795 + .where("module == " + title)
  796 + .select();
749 797  
  798 + $rootScope.openViews.push(
  799 + {
  800 + "module": $rootScope.currentActiveModuleTitle, "BodyView":$rootScope.currentActiveViewTitle, "state": state,
  801 + "slug": $rootScope.currentSlug
  802 + }
  803 + );
  804 +
  805 + }
750 806  
751 807  
752 808  
... ...
400-SOURCECODE/AIAHTML5.Web/app/controllers/HomeController.js
... ... @@ -10,7 +10,10 @@ AIA.controller("HomeController", ["$rootScope","Modules", "$log", "$location", "
10 10 $rootScope.currentBodyViewId = 1;
11 11 $rootScope.currentActiveModuleTitle = 'Welcome to A.D.A.M. Interactive Anatomy';//Modules[0].Name;
12 12 $rootScope.currentActiveViewTitle;
  13 + $rootScope.cuurentActiveModuleId;
13 14 $rootScope.openModules = [];
14   - $rootScope.openViewsDA = [];
  15 + $rootScope.openViews = [];
  16 + $rootScope.currentSlug;
  17 + $rootScope.jsPanelTitle;
15 18 }]
16 19 );
17 20 \ No newline at end of file
... ...
400-SOURCECODE/AIAHTML5.Web/app/views/da/da-body-view-list.html
1   -<div class="bodyWrap row">
  1 +<div class="bodyWrap row ">
2 2 <div ng-include="'MainMenu.html'" />
3 3 <div class="main" ng-init="loadDissectibleAnatomyData()">
4 4 <!--<div class="main">-->
... ...
400-SOURCECODE/AIAHTML5.Web/index.html
... ... @@ -47,11 +47,11 @@
47 47 <div ng-include="'TopMenu.html'"></div>
48 48 </div>
49 49 </nav>
50   - <div class="bodyWrap row">
51   -
52   -
  50 + <div class="bodyWrap row container-fluid">
  51 +
  52 +
53 53 <div ng-view></div>
54   -
  54 +
55 55 </div>
56 56 </div>>
57 57  
... ...
400-SOURCECODE/AIAHTML5.Web/libs/jquery/jquery_plugin/jsPanel/jspanel/jquery.jspanel.css
... ... @@ -129,7 +129,7 @@ h3.jsPanel-title{
129 129 overflow: hidden;
130 130 text-align: left;
131 131 text-overflow: ellipsis;
132   - margin: 10px;
  132 + margin: 0 5px;
133 133 font-variant: normal;
134 134 font-weight: bold;
135 135 cursor: move;
... ...
400-SOURCECODE/AIAHTML5.Web/libs/jquery/jquery_plugin/jsPanel/jspanel/jquery.jspanel.js
... ... @@ -1632,14 +1632,23 @@ console.log(&quot;jsPanel version: &quot; + jsPanel.version);
1632 1632  
1633 1633 // jsPanel minimize
1634 1634 $('.jsPanel-btn-min', jsP).on('click', function (e) {
  1635 + alert('minimized')
1635 1636 e.preventDefault();
1636 1637 jsPanel.minimize(jsP);
  1638 +
  1639 + var $scope = jsPanel.getScope('DAController');
  1640 + $scope.setState('min',jsPanel.header.title);
  1641 + $scope.$apply();
1637 1642 });
1638 1643  
1639 1644 // jsPanel maximize
1640 1645 $('.jsPanel-btn-max', jsP).on('click', function (e) {
1641 1646 e.preventDefault();
1642 1647 jsPanel.maximize(jsP);
  1648 +
  1649 + var $scope = jsPanel.getScope('DAController');
  1650 + $scope.setState('max', jsPanel.header.title);
  1651 + $scope.$apply();
1643 1652 });
1644 1653  
1645 1654 // jsPanel normalize
... ...