diff --git a/400-SOURCECODE/AIAHTML5.Web/app/controllers/CAController.js b/400-SOURCECODE/AIAHTML5.Web/app/controllers/CAController.js index 7fbbf14..4289228 100644 --- a/400-SOURCECODE/AIAHTML5.Web/app/controllers/CAController.js +++ b/400-SOURCECODE/AIAHTML5.Web/app/controllers/CAController.js @@ -40,45 +40,26 @@ 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); } - //var curBodyRegion = localStorage.getItem("CACurBodyRegion"); - //if (typeof (curBodyRegion) !== "undefined" && curBodyRegion !== null && curBodyRegion !== '') { - // $scope.query.selectedbodyregion = curBodyRegion; - //} - //else { - // $scope.query.selectedbodyregion = ""; - //} - - //var curBodySystem = localStorage.getItem("CACurBodySystem"); - //if (typeof (curBodySystem) !== "undefined" && curBodySystem !== null && curBodySystem !== '') { - // $scope.query.selectedbodysystem = curBodySystem; - //} - //else { - // $scope.query.selectedbodysystem = ""; - //} - - //var curSpeciality = localStorage.getItem("CACurSpeciality"); - //if (typeof (curSpeciality) !== "undefined" && curSpeciality !== null && curSpeciality !== '') { - // $scope.query.selectedspecialty = curSpeciality; - //} - //else { - // $scope.query.selectedspecialty = ""; - //} - - - //if ($scope.query.selectedbodyregion == "" && $scope.query.selectedbodysystem == "" && $scope.query.selectedspecialty == "") { - // $scope.loadAllCA(); - //} - //else { - // $scope.ApplySearch($scope.query); - //} - $scope.reRunSearchOnLoad(); }); @@ -197,6 +178,12 @@ 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) { @@ -238,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(); } @@ -582,6 +584,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 046bdb2..15f0753 100644 --- a/400-SOURCECODE/AIAHTML5.Web/app/controllers/CIController.js +++ b/400-SOURCECODE/AIAHTML5.Web/app/controllers/CIController.js @@ -17,6 +17,7 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout $scope.selectedCIListViewData = []; $scope.filterstring = false; $scope.idSelected; + $scope.srollListView; $scope.query = { selectedbodyregion: '', selectedbodysystem: '', @@ -50,59 +51,22 @@ 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(); - //var curBodyRegion = localStorage.getItem("CICurBodyRegion"); - //if (typeof (curBodyRegion) !== "undefined" && curBodyRegion !== null && curBodyRegion !=='') { - // $scope.query.selectedbodyregion = curBodyRegion; - //} - //else { - // $scope.query.selectedbodyregion = ""; - //} - - //var curBodySystem = localStorage.getItem("CICurBodySystem"); - //if (typeof (curBodySystem) !== "undefined" && curBodySystem !== null && curBodySystem !=='') { - // $scope.query.selectedbodysystem = curBodySystem; - //} - //else { - // $scope.query.selectedbodysystem = ""; - //} - - //var curOrientation = localStorage.getItem("CICurOrientation"); - //if (typeof (curOrientation) !== "undefined" && curOrientation !== null && curOrientation !=='') { - // $scope.query.selectedorientation = curOrientation; - //} - //else { - // $scope.query.selectedorientation = ""; - //} - - //var curImageType = localStorage.getItem("CICurImageType"); - //if (typeof (curImageType) !== "undefined" && curImageType !== null && curImageType !=='') { - // $scope.query.selectedimagetype = curImageType; - //} - //else { - // $scope.query.selectedimagetype = ""; - //} - - //var curSpeciality = localStorage.getItem("CICurSpeciality"); - //if (typeof (curSpeciality) !== "undefined" && curSpeciality !== null && curSpeciality !=='') { - // $scope.query.selectedspecialty = curSpeciality; - //} - //else { - // $scope.query.selectedspecialty = ""; - //} - - - //if ($scope.query.selectedbodyregion == "" && $scope.query.selectedbodysystem == "" && $scope.query.selectedorientation == "" && $scope.query.selectedimagetype == "" && $scope.query.selectedspecialty == "") { - // $scope.loadAllCI(); - //} - //else { - // $scope.ApplySearch($scope.query); - //} }); @@ -164,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' }]) @@ -187,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) @@ -229,8 +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) { @@ -274,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) { @@ -345,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) @@ -649,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 199eddc..feb1045 100644 --- a/400-SOURCECODE/AIAHTML5.Web/app/views/ca/ca-view.html +++ b/400-SOURCECODE/AIAHTML5.Web/app/views/ca/ca-view.html @@ -12,7 +12,7 @@
Body Region
-
@@ -20,7 +20,7 @@
Body System
-
@@ -28,7 +28,7 @@
Medical Speciality
-
@@ -68,7 +68,7 @@ Specialty - + {{item._Title}} @@ -84,7 +84,7 @@ - + {{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 968978c..fb50db5 100644 --- a/400-SOURCECODE/AIAHTML5.Web/app/views/ci/ci-view.html +++ b/400-SOURCECODE/AIAHTML5.Web/app/views/ci/ci-view.html @@ -9,7 +9,7 @@
Body Region
-
@@ -17,7 +17,7 @@
Body System
-
@@ -26,7 +26,7 @@
View Orientation
-
@@ -34,7 +34,7 @@
Image Type
-
@@ -42,7 +42,7 @@
Medical Speciality
-
@@ -112,7 +112,7 @@ Specialty - + {{item._Title}} @@ -134,7 +134,7 @@ - + {{item._Title}} @@ -182,3 +182,4 @@
+