diff --git a/400-SOURCECODE/AIAHTML5.Web/app/controllers/CAController.js b/400-SOURCECODE/AIAHTML5.Web/app/controllers/CAController.js index 6af77ca..4d15ed9 100644 --- a/400-SOURCECODE/AIAHTML5.Web/app/controllers/CAController.js +++ b/400-SOURCECODE/AIAHTML5.Web/app/controllers/CAController.js @@ -14,6 +14,7 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout $scope.filterstring = false; $scope.hostedServer = "http://aia5.adam.com/graphics/Multimedia/en/"; $scope.hostedFolderId; + $scope.idSelected; $scope.query = { selectedbodyregion: '', selectedbodysystem: '', @@ -39,13 +40,31 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout //set the local storage var curtab = localStorage.getItem("currentCATabView"); + //if (curtab == 2) { + // $scope.setActiveTab(2); + //} if (curtab == 2) { $scope.setActiveTab(2); + var curSelectedRowId = localStorage.getItem("CASelectedRowId"); + if (typeof (curSelectedRowId) !== "undefined" && curSelectedRowId !== null && curSelectedRowId !== '') { + $scope.reRunSearchOnLoad(); + $scope.idSelected = curSelectedRowId; + $scope.ReloadListViewImageDiv($scope.idSelected); + } + else { + $scope.reRunSearchOnLoad() + $scope.idSelected = ''; + } } else { $scope.setActiveTab(1); } + $scope.reRunSearchOnLoad(); + + }); + + $scope.reRunSearchOnLoad = function () { var curBodyRegion = localStorage.getItem("CACurBodyRegion"); if (typeof (curBodyRegion) !== "undefined" && curBodyRegion !== null && curBodyRegion !== '') { $scope.query.selectedbodyregion = curBodyRegion; @@ -76,10 +95,9 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout } else { $scope.ApplySearch($scope.query); - } - - }); + } + } $scope.LoadCAJsonData = function () { @@ -159,6 +177,13 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout $scope.showItem = function (id) { //console.log(id); + $scope.idSelected = id; + localStorage.setItem("CASelectedRowId", id); + + //Set the vertical scroll value of the table. + var y = $('#ListViewDiv').scrollTop(); + localStorage.setItem("CAListViewScroll", y); + $scope.hiderow = true; if ($scope.filterstring == false) { @@ -200,15 +225,30 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout query.selectedspecialty = ""; //set localstorage values - localStorage.setItem("CACurBodyRegion", query.selectedbodyregion); - localStorage.setItem("CACurBodySystem", query.selectedbodysystem); - localStorage.setItem("CACurSpeciality", query.selectedspecialty); + localStorage.setItem("CACurBodyRegion", ''); + localStorage.setItem("CACurBodySystem", ''); + localStorage.setItem("CACurSpeciality", ''); + localStorage.setItem("CAListViewScroll", ''); + localStorage.setItem("CASelectedRowId", ""); $scope.filterstring = false; + + if ($('.selected').hasClass("selected")) { $('.selected').removeClass("selected"); } + + $('#ListViewDiv').scrollTop(0); + + $scope.HideListViewDiv(); + + while ($scope.searchCAListViewData.length) { $scope.searchCAListViewData.pop(); } + if (localStorage.getItem("currentCATabView") == 2) { + localStorage.setItem("CASelectedRowId", ""); + $scope.hiderow = false; + } + $scope.loadAllCA(); } @@ -545,6 +585,58 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout $scope.videoNumber = vidNumber; }; + $scope.ReloadListViewImageDiv = function (id) { + //console.log(id); + $scope.idSelected = id; + $scope.hiderow = true; + + var promise = DataService.getJson('~/../content/data/json/ca/ca_dat_contentlist.json') + promise.then( + function (result) { + $scope.AnimationData = result; + //$scope.selectedCAListViewData = $scope.AnimationData.root.CAData; + + var SelectedCAthumbImage = []; + SelectedCAthumbImage = new jinqJs() + .from($scope.AnimationData.root.CAData) + .where('_id = ' + id) + .select('_ThumbnailImage', '_Summary', '_id', '_Title'); + + //console.log($scope.selectedCAListViewData); + + $scope.SelectedCAthumbImage = "~/../content/images/ca/thumbnails/" + SelectedCAthumbImage[0]._ThumbnailImage; + + $scope.SelectedCASummary = SelectedCAthumbImage[0]._Summary; + $scope.SelectedCAId = SelectedCAthumbImage[0]._id; + $scope.SelectedCATitle = SelectedCAthumbImage[0]._Title; + + //Set the scroll position of the tablebody to show selected row. + + var curCAListViewScroll = localStorage.getItem("CAListViewScroll"); + if (typeof (curCAListViewScroll) !== "undefined" && curCAListViewScroll !== null && curCAListViewScroll !== '') { + + $('#ListViewDiv').scrollTop(localStorage.getItem("CAListViewScroll")); + } + //else { + // $('#ListViewDiv').scrollTop(0); + //} + + }, + function (error) { + // handle errors here + console.log(' $scope.AnimationData = ' + error.statusText); + } + ); + }; + + $scope.hideListViewDiv = function () { + if (localStorage.getItem("currentCATabView") == 2) { + localStorage.setItem("CASelectedRowId", ""); + if ($('.selected').hasClass("selected")) { $('.selected').removeClass("selected"); } + $scope.hiderow = false; + } + } + }] diff --git a/400-SOURCECODE/AIAHTML5.Web/app/controllers/CIController.js b/400-SOURCECODE/AIAHTML5.Web/app/controllers/CIController.js index f5faba1..15f0753 100644 --- a/400-SOURCECODE/AIAHTML5.Web/app/controllers/CIController.js +++ b/400-SOURCECODE/AIAHTML5.Web/app/controllers/CIController.js @@ -16,6 +16,8 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout $scope.SelectedCITitle = []; $scope.selectedCIListViewData = []; $scope.filterstring = false; + $scope.idSelected; + $scope.srollListView; $scope.query = { selectedbodyregion: '', selectedbodysystem: '', @@ -49,13 +51,29 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout var curtab = localStorage.getItem("currentCITabView"); if (curtab == 2) { $scope.setActiveTab(2); + var curSelectedRowId = localStorage.getItem("CISelectedRowId"); + if (typeof (curSelectedRowId) !== "undefined" && curSelectedRowId !== null && curSelectedRowId !== '') { + $scope.reRunSearchOnLoad(); + $scope.idSelected = curSelectedRowId; + $scope.ReloadListViewImageDiv($scope.idSelected); + } + else { + $scope.reRunSearchOnLoad() + $scope.idSelected = ''; + } } else { $scope.setActiveTab(1); } + $scope.reRunSearchOnLoad(); + + }); + + $scope.reRunSearchOnLoad = function () { + var curBodyRegion = localStorage.getItem("CICurBodyRegion"); - if (typeof (curBodyRegion) !== "undefined" && curBodyRegion !== null && curBodyRegion !=='') { + if (typeof (curBodyRegion) !== "undefined" && curBodyRegion !== null && curBodyRegion !== '') { $scope.query.selectedbodyregion = curBodyRegion; } else { @@ -63,7 +81,7 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout } var curBodySystem = localStorage.getItem("CICurBodySystem"); - if (typeof (curBodySystem) !== "undefined" && curBodySystem !== null && curBodySystem !=='') { + if (typeof (curBodySystem) !== "undefined" && curBodySystem !== null && curBodySystem !== '') { $scope.query.selectedbodysystem = curBodySystem; } else { @@ -71,7 +89,7 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout } var curOrientation = localStorage.getItem("CICurOrientation"); - if (typeof (curOrientation) !== "undefined" && curOrientation !== null && curOrientation !=='') { + if (typeof (curOrientation) !== "undefined" && curOrientation !== null && curOrientation !== '') { $scope.query.selectedorientation = curOrientation; } else { @@ -79,7 +97,7 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout } var curImageType = localStorage.getItem("CICurImageType"); - if (typeof (curImageType) !== "undefined" && curImageType !== null && curImageType !=='') { + if (typeof (curImageType) !== "undefined" && curImageType !== null && curImageType !== '') { $scope.query.selectedimagetype = curImageType; } else { @@ -87,7 +105,7 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout } var curSpeciality = localStorage.getItem("CICurSpeciality"); - if (typeof (curSpeciality) !== "undefined" && curSpeciality !== null && curSpeciality !=='') { + if (typeof (curSpeciality) !== "undefined" && curSpeciality !== null && curSpeciality !== '') { $scope.query.selectedspecialty = curSpeciality; } else { @@ -102,7 +120,7 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout $scope.ApplySearch($scope.query); } - }); + } $scope.LoadCIJsonData = function () { @@ -110,8 +128,6 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout promise.then( function (result) { $scope.IllustrationData = result; - //$scope.selectedCIListViewData = $scope.IllustrationData.root.CIData; - $scope.selectedCIListViewData = new jinqJs() .from($scope.IllustrationData.root.CIData) .orderBy([{ field: '_Title', sort: 'asc' }]) @@ -133,7 +149,6 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout promise.then( function (result) { $scope.IllustrationData = result; - //$scope.selectedCIListViewData = $scope.IllustrationData.root.CIData; $scope.selectedCIListViewData = new jinqJs() .from($scope.IllustrationData.root.CIData) @@ -175,7 +190,13 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout } $scope.showItem = function (id) { - // console.log(id); + $scope.idSelected = id; + localStorage.setItem("CISelectedRowId", id); + + //Set the vertical scroll value of the table. + var y = $('#ListViewDiv').scrollTop(); + localStorage.setItem("CIListViewScroll", y); + $scope.hiderow = true; if ($scope.filterstring == false) { @@ -219,11 +240,19 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout //set localstorage values - localStorage.setItem("CICurBodyRegion", query.selectedbodyregion); - localStorage.setItem("CICurBodySystem", query.selectedbodysystem); - localStorage.setItem("CICurOrientation", query.selectedorientation); - localStorage.setItem("CICurImageType", query.selectedimagetype); - localStorage.setItem("CICurSpeciality", query.selectedspecialty); + localStorage.setItem("CICurBodyRegion", ''); + localStorage.setItem("CICurBodySystem", ''); + localStorage.setItem("CICurOrientation", ''); + localStorage.setItem("CICurImageType", ''); + localStorage.setItem("CICurSpeciality", ''); + localStorage.setItem("CISelectedRowId", ""); + localStorage.setItem("CIListViewScroll", ''); + + if ($('.selected').hasClass("selected")) { $('.selected').removeClass("selected"); } + + $('#ListViewDiv').scrollTop(0); + + $scope.HideListViewDiv(); $scope.filterstring = false; while ($scope.searchCIListViewData.length) { @@ -290,7 +319,6 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout promise.then( function (result) { $scope.IllustrationData = result; - //$scope.selectedCIListViewData = $scope.IllustrationData.root.CIData; $scope.selectedCIListViewData = new jinqJs() .from($scope.IllustrationData.root.CIData) @@ -594,6 +622,54 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout // $rootScope.FreeStylePaint(); }); + $scope.ReloadListViewImageDiv = function (id) { + //console.log(id); + $scope.idSelected = id; + $scope.hiderow = true; + + var promise = DataService.getJson('~/../content/data/json/ci/ci_dat_contentlist.json') + promise.then( + function (result) { + $scope.IllustrationData = result; + + var SelectedCIthumbImage = []; + SelectedCIthumbImage = new jinqJs() + .from($scope.IllustrationData.root.CIData) + .where('_id = ' + id) + .select('_ThumbnailImage', '_Summary', '_id', '_Title'); + + $scope.SelectedCIthumbImage = "~/../content/images/ci/thumbnails/" + SelectedCIthumbImage[0]._ThumbnailImage; + $scope.SelectedCISummary = SelectedCIthumbImage[0]._Summary; + $scope.SelectedCIId = SelectedCIthumbImage[0]._id; + $scope.SelectedCITitle = SelectedCIthumbImage[0]._Title; + + //Set the scroll position of the tablebody to show selected row. + + var curCIListViewScroll = localStorage.getItem("CIListViewScroll"); + if (typeof (curCIListViewScroll) !== "undefined" && curCIListViewScroll !== null && curCIListViewScroll !== '') { + + $('#ListViewDiv').scrollTop(localStorage.getItem("CIListViewScroll")); + } + //else { + // $('#ListViewDiv').scrollTop(0); + //} + + }, + function (error) { + // handle errors here + console.log(' $scope.AnimationData = ' + error.statusText); + } + ); + }; + + $scope.hideListViewDiv = function () { + if (localStorage.getItem("currentCITabView") == 2) { + localStorage.setItem("CISelectedRowId", ""); + if ($('.selected').hasClass("selected")) { $('.selected').removeClass("selected"); } + $scope.hiderow = false; + } + } + }] diff --git a/400-SOURCECODE/AIAHTML5.Web/app/views/ca/ca-view.html b/400-SOURCECODE/AIAHTML5.Web/app/views/ca/ca-view.html index fa48772..feb1045 100644 --- a/400-SOURCECODE/AIAHTML5.Web/app/views/ca/ca-view.html +++ b/400-SOURCECODE/AIAHTML5.Web/app/views/ca/ca-view.html @@ -1,4 +1,5 @@ -
+ +
@@ -11,7 +12,7 @@
Body Region
-
@@ -19,7 +20,7 @@
Body System
-
@@ -27,7 +28,7 @@
Medical Speciality
-
@@ -67,8 +68,8 @@ Specialty - - + + {{item._Title}} @@ -83,8 +84,8 @@ - - + + {{item._Title}} diff --git a/400-SOURCECODE/AIAHTML5.Web/app/views/ci/ci-view.html b/400-SOURCECODE/AIAHTML5.Web/app/views/ci/ci-view.html index ad4f614..fb50db5 100644 --- a/400-SOURCECODE/AIAHTML5.Web/app/views/ci/ci-view.html +++ b/400-SOURCECODE/AIAHTML5.Web/app/views/ci/ci-view.html @@ -1,4 +1,5 @@ -
+ +
@@ -8,7 +9,7 @@
Body Region
-
@@ -16,7 +17,7 @@
Body System
-
@@ -25,7 +26,7 @@
View Orientation
-
@@ -33,7 +34,7 @@
Image Type
-
@@ -41,7 +42,7 @@
Medical Speciality
-
@@ -111,8 +112,8 @@ Specialty - - + + {{item._Title}} @@ -133,8 +134,8 @@ - - + + {{item._Title}} @@ -160,7 +161,7 @@
-
+
@@ -181,3 +182,4 @@
+ diff --git a/400-SOURCECODE/AIAHTML5.Web/themes/default/css/bootstrap/3.3.6/main.css b/400-SOURCECODE/AIAHTML5.Web/themes/default/css/bootstrap/3.3.6/main.css index d234978..1b097b3 100644 --- a/400-SOURCECODE/AIAHTML5.Web/themes/default/css/bootstrap/3.3.6/main.css +++ b/400-SOURCECODE/AIAHTML5.Web/themes/default/css/bootstrap/3.3.6/main.css @@ -905,4 +905,8 @@ background-image: url("../../../../../content/images/blank-shapes.png"); height:100%; background:#fff; border-radius: 50%; - } \ No newline at end of file + } +/*Bug #8679*/ + .selected { + background-color: lightgrey; + } \ No newline at end of file