Commit dcc1d3823f5caefbfa38f6563f6471b7cb94fe9a

Authored by Mitali Srivastava
1 parent 51b75071

Bug #5262 Maintain state after detail page is closed

Bug #7960 CI > Maintain state of the List View
Bug #7962 CA > Maintain state of the List View
Bug #2316 Navigation to Clinical Illustrations Module

Listview and grid view state have to be maintained in all the modules which show it in the main menu. 3danatomy should not have listview and gridview so removed from it.
400-SOURCECODE/AIAHTML5.Web/app/controllers/3dAController.js
... ... @@ -2,7 +2,7 @@
2 2 function ($scope, $rootScope, pages, log, $http, DataService, $filter, $location, $document, $sce, $compile) {
3 3  
4 4 $rootScope.currentActiveModuleTitle = pages[5].name;
5   - $scope.showme = true;
  5 + $scope.showme = false;
6 6 $scope.threedanatomyData;
7 7 $scope.Id;
8 8 $scope.$on('$viewContentLoaded', function (event) {
... ...
400-SOURCECODE/AIAHTML5.Web/app/controllers/AODController.js
1 1 AIA.controller("AODController", ["$scope", "$rootScope", "pages", "$log",
2 2 function ($scope, $rootScope, pages, log) {
3   - $scope.showme = true;
4   - $scope.IsVisible = function () {
5   - $scope.scroll();
  3 + //$scope.showme = true;
  4 + //$scope.IsVisible = function () {
  5 + // $scope.scroll();
6 6  
7   - }
  7 + //}
  8 +
  9 + $scope.setActiveTab = function (tabToSet) {
  10 + $scope.activeTab = tabToSet;
  11 + localStorage.setItem("currentAODTabView", $scope.activeTab);
  12 + };
8 13  
9 14 $scope.scroll = function () {
10 15 // $window.scrollTo(0, 0);
11 16 $("html,body").scrollTop(0);
12 17 //alert("scroll");
13 18 }
14   - $rootScope.currentActiveModuleTitle = pages[10].name;
  19 + //$rootScope.currentActiveModuleTitle = pages[10].name;
  20 +
  21 + $scope.$on('$viewContentLoaded', function (event) {
  22 + // code that will be executed ...
  23 + // every time this view is loaded
  24 +
  25 + $scope.showme = true;
  26 + $scope.IsVisible = function () {
  27 + $scope.scroll();
  28 +
  29 + }
  30 +
  31 + $rootScope.currentActiveModuleTitle = pages[10].name;
  32 +
  33 + //set the local storage
  34 +
  35 + var curtab = localStorage.getItem("currentAODTabView");
  36 + if (curtab == 2) {
  37 + $scope.setActiveTab(2);
  38 + }
  39 + else {
  40 + $scope.setActiveTab(1);
  41 + }
  42 +
  43 + });
  44 +
15 45 }]
16 46  
17 47  
... ...
400-SOURCECODE/AIAHTML5.Web/app/controllers/CAController.js
... ... @@ -18,6 +18,11 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, pages, B
18 18 selectedspecialty: '',
19 19 };
20 20  
  21 + $scope.setActiveTab = function (tabToSet) {
  22 + $scope.activeTab = tabToSet;
  23 + localStorage.setItem("currentCATabView", $scope.activeTab);
  24 + };
  25 +
21 26 $scope.$on('$viewContentLoaded', function (event) {
22 27 // code that will be executed ...
23 28 // every time this view is loaded
... ... @@ -30,6 +35,15 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, pages, B
30 35 $scope.scroll();
31 36  
32 37 //set the local storage
  38 +
  39 + var curtab = localStorage.getItem("currentCATabView");
  40 + if (curtab == 2) {
  41 + $scope.setActiveTab(2);
  42 + }
  43 + else {
  44 + $scope.setActiveTab(1);
  45 + }
  46 +
33 47 var curBodyRegion = localStorage.getItem("CACurBodyRegion");
34 48 if (typeof (curBodyRegion) !== "undefined" && curBodyRegion !== null) {
35 49 $scope.query.selectedbodyregion = curBodyRegion;
... ...
400-SOURCECODE/AIAHTML5.Web/app/controllers/CIController.js
... ... @@ -24,6 +24,11 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout
24 24 selectedspecialty: '',
25 25 };
26 26  
  27 + $scope.setActiveTab = function (tabToSet) {
  28 + $scope.activeTab = tabToSet;
  29 + localStorage.setItem("currentCITabView", $scope.activeTab);
  30 + };
  31 +
27 32 $scope.$on('$viewContentLoaded', function (event) {
28 33 // code that will be executed ...
29 34 // every time this view is loaded
... ... @@ -40,6 +45,15 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout
40 45 $rootScope.openModules.push({ "ModuleId": 4 });
41 46  
42 47 //set the local storage
  48 +
  49 + var curtab = localStorage.getItem("currentCITabView");
  50 + if (curtab == 2) {
  51 + $scope.setActiveTab(2);
  52 + }
  53 + else {
  54 + $scope.setActiveTab(1);
  55 + }
  56 +
43 57 var curBodyRegion = localStorage.getItem("CICurBodyRegion");
44 58 if (typeof (curBodyRegion) !== "undefined" && curBodyRegion !== null) {
45 59 $scope.query.selectedbodyregion = curBodyRegion;
... ... @@ -126,7 +140,7 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout
126 140 .orderBy([{ field: '_Title', sort: 'asc' }])
127 141 .select();
128 142  
129   - console.log($scope.selectedCIListViewData);
  143 + //console.log($scope.selectedCIListViewData);
130 144 $('#grid-view').empty();
131 145 angular.forEach($scope.selectedCIListViewData, function (value, key) {
132 146 $scope.imagePath = "~/../content/images/ci/thumbnails/" + value._ThumbnailImage;
... ...
400-SOURCECODE/AIAHTML5.Web/app/views/AOD/AOD-view.html
... ... @@ -4,7 +4,7 @@
4 4  
5 5  
6 6 <div class="row tab-content" style="padding-left:25px; width:99%">
7   - <div role="tabpanel" class="tab-pane active" id="grid-view">
  7 + <div role="tabpanel" ng-class="{'tab-pane active' : activeTab === 1,'tab-pane' : activeTab !==1 }" id="grid-view">
8 8 <div class="col-sm-3 col-lg-2">
9 9 <div class="thumbnail">
10 10 <a href="clinical-animations-details.html">
... ... @@ -220,7 +220,7 @@
220 220  
221 221  
222 222 </div>
223   - <div role="tabpanel" class="tab-pane" id="list-view">
  223 + <div role="tabpanel" ng-class="{'tab-pane active' : activeTab === 2,'tab-pane' : activeTab !==2 }" id="list-view">
224 224 <div class="col-sm-12 table-responsive ">
225 225 <table class="table table-hover table-condensed bg-white">
226 226 <thead>
... ...
400-SOURCECODE/AIAHTML5.Web/app/views/ca/ca-view.html
... ... @@ -6,7 +6,7 @@
6 6 <div class="col-sm-12 stickey-area clsstickydiv">
7 7 <div class="breadcrumb">
8 8 <div class="row center-block">
9   - <h5 class="text-center text-primary txt-white f15">Display Image By</h5>
  9 + <h5 class="text-center text-primary txt-white f15">Display Animation By</h5>
10 10 <div class="col-sm-2">&nbsp;</div>
11 11 <div class="col-md-2 col-sm-4 pad-lftrgt3">
12 12 <div class="form-group">
... ... @@ -43,9 +43,9 @@
43 43 </div>
44 44 </div>
45 45 <div class="row tab-content" style="padding-left:25px; width:99%">
46   - <div role="tabpanel" class="tab-pane active" id="grid-view">
  46 + <div role="tabpanel" ng-class="{'tab-pane active' : activeTab === 1,'tab-pane' : activeTab !==1 }" id="grid-view">
47 47 </div>
48   - <div role="tabpanel" class="tab-pane" id="list-view">
  48 + <div role="tabpanel" ng-class="{'tab-pane active' : activeTab === 2,'tab-pane' : activeTab !==2 }" id="list-view">
49 49 <div class="panel col-sm-12 table-responsive" style="padding-left:0px; padding-right:0; margin-left:11px; margin-bottom:0; width:99%;">
50 50 <table class="table table-hover table-fixed bg-white table-txt12" style="padding-left:25px; width:100%;">
51 51 <thead class="clstheadca">
... ...
400-SOURCECODE/AIAHTML5.Web/app/views/ci/ci-view.html
... ... @@ -59,32 +59,35 @@
59 59  
60 60 <div class="row tab-content" style="padding-left:25px; width:99%">
61 61  
62   - <div role="tabpanel" class="tab-pane active" id="grid-view">
63   - <!--<div ng-if="!filterstring" ng-repeat="item in selectedCIListViewData">
64   - <div id="{{item._id}}" class="col-sm-3 col-lg-2" title="{{item._Title}}" data-ng-click="openView($event)">
65   - <div class="thumbnail">
66   - <img ng-src="~ /../content/images/ci/thumbnails/{{item._ThumbnailImage}}" alt="" title="">
67   - <div class="caption">
68   - <p>{{item._Title}}</p>
69   - </div>
  62 + <!--<div role="tabpanel" class="tab-pane active" id="grid-view">-->
  63 + <div role="tabpanel" ng-class="{'tab-pane active' : activeTab === 1,'tab-pane' : activeTab !==1 }" id="grid-view">
  64 + <!--<div ng-if="!filterstring" ng-repeat="item in selectedCIListViewData">
  65 + <div id="{{item._id}}" class="col-sm-3 col-lg-2" title="{{item._Title}}" data-ng-click="openView($event)">
  66 + <div class="thumbnail">
  67 + <img ng-src="~ /../content/images/ci/thumbnails/{{item._ThumbnailImage}}" alt="" title="">
  68 + <div class="caption">
  69 + <p>{{item._Title}}</p>
70 70 </div>
71 71 </div>
72 72 </div>
  73 + </div>
73 74  
74   - <div ng-if="filterstring" ng-repeat="item in searchCIListViewData">
75   - <div id="{{item._id}}" class="col-sm-3 col-lg-2" title="{{item._Title}}" data-ng-click="openView($event)">
76   - <div class="thumbnail">
77   - <img ng-src="~ /../content/images/ci/thumbnails/{{item._ThumbnailImage}}" alt="" title="">
78   - <div class="caption">
79   - <p>{{item._Title}}</p>
80   - </div>
  75 + <div ng-if="filterstring" ng-repeat="item in searchCIListViewData">
  76 + <div id="{{item._id}}" class="col-sm-3 col-lg-2" title="{{item._Title}}" data-ng-click="openView($event)">
  77 + <div class="thumbnail">
  78 + <img ng-src="~ /../content/images/ci/thumbnails/{{item._ThumbnailImage}}" alt="" title="">
  79 + <div class="caption">
  80 + <p>{{item._Title}}</p>
81 81 </div>
82 82 </div>
83   - </div>-->
  83 + </div>
  84 + </div>-->
84 85  
85   - </div>
  86 +</div>
86 87  
87   - <div role="tabpanel" class="tab-pane" id="list-view">
  88 +di
  89 + <!--<div role="tabpanel" class="tab-pane" id="list-view">-->
  90 + <div role="tabpanel" ng-class="{'tab-pane active' : activeTab === 2,'tab-pane' : activeTab !==2 }" id="list-view">
88 91 <!--<div class="col-sm-12 table-responsive">-->
89 92 <div class="panel col-sm-12 table-responsive" style="padding-left:0px; padding-right:0; margin-left:11px; margin-bottom:0; width:99%;">
90 93 <!--<table class="table table-hover table-condensed bg-white" style="padding-left:25px; width:99%">-->
... ...
400-SOURCECODE/AIAHTML5.Web/app/widget/MainMenu.html
... ... @@ -9,8 +9,14 @@
9 9 <ul class="listgrid-view" role="tablist">
10 10 <!--<li role="presentation" class="active" title="Image View"><a href="#grid-view" aria-controls="grid-view" role="tab" data-toggle="tab" class="" ><i class=" fa fa-image"></i></a></li>
11 11 <li role="presentation" title="List View"><a href="#list-view" aria-controls="list-view" role="tab" data-toggle="tab" class="" ><i class="fa fa-list-alt"></i></a></li>-->
12   - <li role="presentation" class="active" title="Image View"><i class=" fa fa-image txt-white cur-pot" href="#grid-view" aria-controls="grid-view" role="tab" data-toggle="tab"></i></li>
13   - <li role="presentation" title="List View"><i class="fa fa-list-alt txt-white cur-pot" href="#list-view" aria-controls="list-view" role="tab" data-toggle="tab"></i></li>
  12 +
  13 + <!--Working-->
  14 + <!--<li role="presentation" class="active" title="Image View"><i class=" fa fa-image txt-white cur-pot" href="#grid-view" aria-controls="grid-view" role="tab" data-toggle="tab"></i></li>
  15 + <li role="presentation" title="List View"><i class="fa fa-list-alt txt-white cur-pot" href="#list-view" aria-controls="list-view" role="tab" data-toggle="tab"></i></li>-->
  16 +
  17 + <li role="presentation" ng-class="{'active':activeTab==1}" title="Image View"><i class=" fa fa-image txt-white cur-pot" ng-click="setActiveTab(1)" href="#grid-view" aria-controls="grid-view" role="tab" data-toggle="tab"></i></li>
  18 + <li role="presentation" ng-class="{'active':activeTab==2}" title="List View"><i class="fa fa-list-alt txt-white cur-pot" ng-click="setActiveTab(2)" href="#list-view" aria-controls="list-view" role="tab" data-toggle="tab"></i></li>
  19 +
14 20 </ul>
15 21 </div>
16 22 </div>
... ...