diff --git a/400-SOURCECODE/AIAHTML5.Web/app/controllers/CAController.js b/400-SOURCECODE/AIAHTML5.Web/app/controllers/CAController.js index 9430a0f..9544b98 100644 --- a/400-SOURCECODE/AIAHTML5.Web/app/controllers/CAController.js +++ b/400-SOURCECODE/AIAHTML5.Web/app/controllers/CAController.js @@ -222,18 +222,29 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, pages, B //$('#grid-view').empty(); filtercount = 0; - if (typeof (query.selectedbodyregion) !== "undefined" && query.selectedbodyregion !== null) { + if (typeof (query.selectedbodyregion) !== "undefined" && query.selectedbodyregion !== null && query.selectedbodyregion !== "") { filtercount = filtercount + 1; localStorage.setItem("CACurBodyRegion", query.selectedbodyregion); } - if (typeof (query.selectedbodysystem) !== "undefined" && query.selectedbodysystem !== null) { + else { + localStorage.setItem("CACurBodyRegion", ''); + } + + if (typeof (query.selectedbodysystem) !== "undefined" && query.selectedbodysystem !== null && query.selectedbodysystem !== "") { filtercount = filtercount + 1; localStorage.setItem("CACurBodySystem", query.selectedbodysystem); } - if (typeof (query.selectedspecialty) !== "undefined" && query.selectedspecialty !== null) { + else { + localStorage.setItem("CACurBodySystem", ''); + } + + if (typeof (query.selectedspecialty) !== "undefined" && query.selectedspecialty !== null && query.selectedspecialty !== "") { filtercount = filtercount + 1; localStorage.setItem("CACurSpeciality", query.selectedspecialty); } + else { + localStorage.setItem("CACurSpeciality", ''); + } var promise = DataService.getJson('~/../content/data/json/ca/ca_dat_contentlist.json') promise.then( @@ -256,7 +267,7 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, pages, B var count = 0; - if (typeof (query.selectedbodyregion) !== "undefined" && query.selectedbodyregion !== null) { + if (typeof (query.selectedbodyregion) !== "undefined" && query.selectedbodyregion !== null && query.selectedbodyregion !== "") { var posbodyregion = value._BodyRegion.indexOf((query.selectedbodyregion.trim())); if (posbodyregion > -1) { selectimg = true; @@ -270,7 +281,7 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, pages, B } - if (typeof (query.selectedbodysystem) !== "undefined" && query.selectedbodysystem !== null) { + if (typeof (query.selectedbodysystem) !== "undefined" && query.selectedbodysystem !== null && query.selectedbodysystem !=="") { var posbodysystem = value._BodySystem.indexOf(query.selectedbodysystem); if (posbodysystem > -1) { count = count + 1; @@ -281,7 +292,7 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, pages, B } } - if (typeof (query.selectedspecialty) !== "undefined" && query.selectedspecialty !== null) { + if (typeof (query.selectedspecialty) !== "undefined" && query.selectedspecialty !== null && query.selectedspecialty !=="") { var posspeciality = value._MedicalSpecialty.indexOf(query.selectedspecialty); if (posspeciality > -1) { count = count + 1; diff --git a/400-SOURCECODE/AIAHTML5.Web/app/controllers/CIController.js b/400-SOURCECODE/AIAHTML5.Web/app/controllers/CIController.js index eb968c7..7068df1 100644 --- a/400-SOURCECODE/AIAHTML5.Web/app/controllers/CIController.js +++ b/400-SOURCECODE/AIAHTML5.Web/app/controllers/CIController.js @@ -33,7 +33,7 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout // code that will be executed ... // every time this view is loaded - $scope.LoadCIJsonData(); + $scope.LoadCIJsonData(); $scope.CIAllBodyRegion = BodyRegions; $scope.CIAllBodySystem = BodySystems; @@ -140,7 +140,7 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout .orderBy([{ field: '_Title', sort: 'asc' }]) .select(); - //console.log($scope.selectedCIListViewData); + console.log($scope.selectedCIListViewData); $('#grid-view').empty(); angular.forEach($scope.selectedCIListViewData, function (value, key) { $scope.imagePath = "~/../content/images/ci/thumbnails/" + value._ThumbnailImage; @@ -245,26 +245,45 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout //$('#grid-view').empty(); filtercount = 0; - if (typeof (query.selectedbodyregion) !== "undefined" && (query.selectedbodyregion !== null || query.selectedbodyregion !== "null")) { + if (typeof (query.selectedbodyregion) !== "undefined" && (query.selectedbodyregion !== null && query.selectedbodyregion !== "")) { filtercount = filtercount + 1; localStorage.setItem("CICurBodyRegion", query.selectedbodyregion); } - if (typeof (query.selectedbodysystem) !== "undefined" && (query.selectedbodysystem !== null || query.selectedbodysystem !== "null")) { + else { + localStorage.setItem("CICurBodyRegion", ''); + } + + if (typeof (query.selectedbodysystem) !== "undefined" && (query.selectedbodysystem !== null && query.selectedbodysystem !=="")) { filtercount = filtercount + 1; localStorage.setItem("CICurBodySystem", query.selectedbodysystem); } - if (typeof (query.selectedorientation) !== "undefined" && (query.selectedorientation !== null || query.selectedorientation !== "null")) { + else { + localStorage.setItem("CICurBodySystem", ''); + } + + if (typeof (query.selectedorientation) !== "undefined" && (query.selectedorientation !== null && query.selectedorientation !== '')) { filtercount = filtercount + 1; localStorage.setItem("CICurOrientation", query.selectedorientation); } - if (typeof (query.selectedimagetype) !== "undefined" && (query.selectedimagetype !== null || query.selectedimagetype !== "null")) { + else { + localStorage.setItem("CICurOrientation", ''); + } + + if (typeof (query.selectedimagetype) !== "undefined" && (query.selectedimagetype !== null && query.selectedimagetype !== '')) { filtercount = filtercount + 1; localStorage.setItem("CICurImageType", query.selectedimagetype); } - if (typeof (query.selectedspecialty) !== "undefined" && (query.selectedspecialty !== null || query.selectedspecialty !== "null")) { + else { + localStorage.setItem("CICurImageType", ''); + } + + if (typeof (query.selectedspecialty) !== "undefined" && (query.selectedspecialty !== null && query.selectedspecialty !== '')) { filtercount = filtercount + 1; localStorage.setItem("CICurSpeciality", query.selectedspecialty); } + else { + localStorage.setItem("CICurSpeciality", ''); + } var promise = DataService.getJson('~/../content/data/json/ci/ci_dat_contentlist.json') @@ -286,7 +305,7 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout var count = 0; - if (typeof (query.selectedbodyregion) !== "undefined" && (query.selectedbodyregion !== null || query.selectedbodyregion !== "null")) { + if (typeof (query.selectedbodyregion) !== "undefined" && (query.selectedbodyregion !== null && query.selectedbodyregion !== "")) { var posbodyregion = value._BodyRegion.indexOf((query.selectedbodyregion.trim())); if (posbodyregion > -1) { selectimg = true; @@ -300,7 +319,7 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout } - if (typeof (query.selectedbodysystem) !== "undefined" && (query.selectedbodysystem !== null || query.selectedbodysystem !== "null")) { + if (typeof (query.selectedbodysystem) !== "undefined" && (query.selectedbodysystem !== null && query.selectedbodysystem !== "")) { var posbodysystem = value._BodySystem.indexOf(query.selectedbodysystem); if (posbodysystem > -1) { count = count + 1; @@ -311,7 +330,7 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout } } - if (typeof (query.selectedorientation) !== "undefined" && (query.selectedorientation !== null || query.selectedorientation !== "null")) { + if (typeof (query.selectedorientation) !== "undefined" && (query.selectedorientation !== null && query.selectedorientation !== "")) { var posorientation = value._ViewOrientation.indexOf(query.selectedorientation); if (posorientation > -1) { count = count + 1; @@ -324,7 +343,7 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout } - if (typeof (query.selectedimagetype) !== "undefined" && (query.selectedimagetype !== null || query.selectedimagetype !== "null")) { + if (typeof (query.selectedimagetype) !== "undefined" && (query.selectedimagetype !== null && query.selectedimagetype !== "")) { var posimagetype = value._ImageType.indexOf(query.selectedimagetype); if (posimagetype > -1) { count = count + 1; @@ -337,7 +356,7 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout } - if (typeof (query.selectedspecialty) !== "undefined" && (query.selectedspecialty !== null || query.selectedspecialty !== "null")) { + if (typeof (query.selectedspecialty) !== "undefined" && (query.selectedspecialty !== null && query.selectedspecialty !== "")) { var posspeciality = value._MedicalSpecialty.indexOf(query.selectedspecialty); if (posspeciality > -1) { count = count + 1;