Commit 1feaaddf6a8dc39a238e0ad00285582c4e816764
1 parent
dcc1d382
Bug #5263: Maintain combo box selection after detailpage is unloaded and CI is loaded
Showing
2 changed files
with
48 additions
and
18 deletions
400-SOURCECODE/AIAHTML5.Web/app/controllers/CAController.js
@@ -222,18 +222,29 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, pages, B | @@ -222,18 +222,29 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, pages, B | ||
222 | //$('#grid-view').empty(); | 222 | //$('#grid-view').empty(); |
223 | 223 | ||
224 | filtercount = 0; | 224 | filtercount = 0; |
225 | - if (typeof (query.selectedbodyregion) !== "undefined" && query.selectedbodyregion !== null) { | 225 | + if (typeof (query.selectedbodyregion) !== "undefined" && query.selectedbodyregion !== null && query.selectedbodyregion !== "") { |
226 | filtercount = filtercount + 1; | 226 | filtercount = filtercount + 1; |
227 | localStorage.setItem("CACurBodyRegion", query.selectedbodyregion); | 227 | localStorage.setItem("CACurBodyRegion", query.selectedbodyregion); |
228 | } | 228 | } |
229 | - if (typeof (query.selectedbodysystem) !== "undefined" && query.selectedbodysystem !== null) { | 229 | + else { |
230 | + localStorage.setItem("CACurBodyRegion", ''); | ||
231 | + } | ||
232 | + | ||
233 | + if (typeof (query.selectedbodysystem) !== "undefined" && query.selectedbodysystem !== null && query.selectedbodysystem !== "") { | ||
230 | filtercount = filtercount + 1; | 234 | filtercount = filtercount + 1; |
231 | localStorage.setItem("CACurBodySystem", query.selectedbodysystem); | 235 | localStorage.setItem("CACurBodySystem", query.selectedbodysystem); |
232 | } | 236 | } |
233 | - if (typeof (query.selectedspecialty) !== "undefined" && query.selectedspecialty !== null) { | 237 | + else { |
238 | + localStorage.setItem("CACurBodySystem", ''); | ||
239 | + } | ||
240 | + | ||
241 | + if (typeof (query.selectedspecialty) !== "undefined" && query.selectedspecialty !== null && query.selectedspecialty !== "") { | ||
234 | filtercount = filtercount + 1; | 242 | filtercount = filtercount + 1; |
235 | localStorage.setItem("CACurSpeciality", query.selectedspecialty); | 243 | localStorage.setItem("CACurSpeciality", query.selectedspecialty); |
236 | } | 244 | } |
245 | + else { | ||
246 | + localStorage.setItem("CACurSpeciality", ''); | ||
247 | + } | ||
237 | 248 | ||
238 | var promise = DataService.getJson('~/../content/data/json/ca/ca_dat_contentlist.json') | 249 | var promise = DataService.getJson('~/../content/data/json/ca/ca_dat_contentlist.json') |
239 | promise.then( | 250 | promise.then( |
@@ -256,7 +267,7 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, pages, B | @@ -256,7 +267,7 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, pages, B | ||
256 | var count = 0; | 267 | var count = 0; |
257 | 268 | ||
258 | 269 | ||
259 | - if (typeof (query.selectedbodyregion) !== "undefined" && query.selectedbodyregion !== null) { | 270 | + if (typeof (query.selectedbodyregion) !== "undefined" && query.selectedbodyregion !== null && query.selectedbodyregion !== "") { |
260 | var posbodyregion = value._BodyRegion.indexOf((query.selectedbodyregion.trim())); | 271 | var posbodyregion = value._BodyRegion.indexOf((query.selectedbodyregion.trim())); |
261 | if (posbodyregion > -1) { | 272 | if (posbodyregion > -1) { |
262 | selectimg = true; | 273 | selectimg = true; |
@@ -270,7 +281,7 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, pages, B | @@ -270,7 +281,7 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, pages, B | ||
270 | 281 | ||
271 | } | 282 | } |
272 | 283 | ||
273 | - if (typeof (query.selectedbodysystem) !== "undefined" && query.selectedbodysystem !== null) { | 284 | + if (typeof (query.selectedbodysystem) !== "undefined" && query.selectedbodysystem !== null && query.selectedbodysystem !=="") { |
274 | var posbodysystem = value._BodySystem.indexOf(query.selectedbodysystem); | 285 | var posbodysystem = value._BodySystem.indexOf(query.selectedbodysystem); |
275 | if (posbodysystem > -1) { | 286 | if (posbodysystem > -1) { |
276 | count = count + 1; | 287 | count = count + 1; |
@@ -281,7 +292,7 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, pages, B | @@ -281,7 +292,7 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, pages, B | ||
281 | } | 292 | } |
282 | } | 293 | } |
283 | 294 | ||
284 | - if (typeof (query.selectedspecialty) !== "undefined" && query.selectedspecialty !== null) { | 295 | + if (typeof (query.selectedspecialty) !== "undefined" && query.selectedspecialty !== null && query.selectedspecialty !=="") { |
285 | var posspeciality = value._MedicalSpecialty.indexOf(query.selectedspecialty); | 296 | var posspeciality = value._MedicalSpecialty.indexOf(query.selectedspecialty); |
286 | if (posspeciality > -1) { | 297 | if (posspeciality > -1) { |
287 | count = count + 1; | 298 | count = count + 1; |
400-SOURCECODE/AIAHTML5.Web/app/controllers/CIController.js
@@ -33,7 +33,7 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout | @@ -33,7 +33,7 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout | ||
33 | // code that will be executed ... | 33 | // code that will be executed ... |
34 | // every time this view is loaded | 34 | // every time this view is loaded |
35 | 35 | ||
36 | - $scope.LoadCIJsonData(); | 36 | + $scope.LoadCIJsonData(); |
37 | 37 | ||
38 | $scope.CIAllBodyRegion = BodyRegions; | 38 | $scope.CIAllBodyRegion = BodyRegions; |
39 | $scope.CIAllBodySystem = BodySystems; | 39 | $scope.CIAllBodySystem = BodySystems; |
@@ -140,7 +140,7 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout | @@ -140,7 +140,7 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout | ||
140 | .orderBy([{ field: '_Title', sort: 'asc' }]) | 140 | .orderBy([{ field: '_Title', sort: 'asc' }]) |
141 | .select(); | 141 | .select(); |
142 | 142 | ||
143 | - //console.log($scope.selectedCIListViewData); | 143 | + console.log($scope.selectedCIListViewData); |
144 | $('#grid-view').empty(); | 144 | $('#grid-view').empty(); |
145 | angular.forEach($scope.selectedCIListViewData, function (value, key) { | 145 | angular.forEach($scope.selectedCIListViewData, function (value, key) { |
146 | $scope.imagePath = "~/../content/images/ci/thumbnails/" + value._ThumbnailImage; | 146 | $scope.imagePath = "~/../content/images/ci/thumbnails/" + value._ThumbnailImage; |
@@ -245,26 +245,45 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout | @@ -245,26 +245,45 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout | ||
245 | //$('#grid-view').empty(); | 245 | //$('#grid-view').empty(); |
246 | 246 | ||
247 | filtercount = 0; | 247 | filtercount = 0; |
248 | - if (typeof (query.selectedbodyregion) !== "undefined" && (query.selectedbodyregion !== null || query.selectedbodyregion !== "null")) { | 248 | + if (typeof (query.selectedbodyregion) !== "undefined" && (query.selectedbodyregion !== null && query.selectedbodyregion !== "")) { |
249 | filtercount = filtercount + 1; | 249 | filtercount = filtercount + 1; |
250 | localStorage.setItem("CICurBodyRegion", query.selectedbodyregion); | 250 | localStorage.setItem("CICurBodyRegion", query.selectedbodyregion); |
251 | } | 251 | } |
252 | - if (typeof (query.selectedbodysystem) !== "undefined" && (query.selectedbodysystem !== null || query.selectedbodysystem !== "null")) { | 252 | + else { |
253 | + localStorage.setItem("CICurBodyRegion", ''); | ||
254 | + } | ||
255 | + | ||
256 | + if (typeof (query.selectedbodysystem) !== "undefined" && (query.selectedbodysystem !== null && query.selectedbodysystem !=="")) { | ||
253 | filtercount = filtercount + 1; | 257 | filtercount = filtercount + 1; |
254 | localStorage.setItem("CICurBodySystem", query.selectedbodysystem); | 258 | localStorage.setItem("CICurBodySystem", query.selectedbodysystem); |
255 | } | 259 | } |
256 | - if (typeof (query.selectedorientation) !== "undefined" && (query.selectedorientation !== null || query.selectedorientation !== "null")) { | 260 | + else { |
261 | + localStorage.setItem("CICurBodySystem", ''); | ||
262 | + } | ||
263 | + | ||
264 | + if (typeof (query.selectedorientation) !== "undefined" && (query.selectedorientation !== null && query.selectedorientation !== '')) { | ||
257 | filtercount = filtercount + 1; | 265 | filtercount = filtercount + 1; |
258 | localStorage.setItem("CICurOrientation", query.selectedorientation); | 266 | localStorage.setItem("CICurOrientation", query.selectedorientation); |
259 | } | 267 | } |
260 | - if (typeof (query.selectedimagetype) !== "undefined" && (query.selectedimagetype !== null || query.selectedimagetype !== "null")) { | 268 | + else { |
269 | + localStorage.setItem("CICurOrientation", ''); | ||
270 | + } | ||
271 | + | ||
272 | + if (typeof (query.selectedimagetype) !== "undefined" && (query.selectedimagetype !== null && query.selectedimagetype !== '')) { | ||
261 | filtercount = filtercount + 1; | 273 | filtercount = filtercount + 1; |
262 | localStorage.setItem("CICurImageType", query.selectedimagetype); | 274 | localStorage.setItem("CICurImageType", query.selectedimagetype); |
263 | } | 275 | } |
264 | - if (typeof (query.selectedspecialty) !== "undefined" && (query.selectedspecialty !== null || query.selectedspecialty !== "null")) { | 276 | + else { |
277 | + localStorage.setItem("CICurImageType", ''); | ||
278 | + } | ||
279 | + | ||
280 | + if (typeof (query.selectedspecialty) !== "undefined" && (query.selectedspecialty !== null && query.selectedspecialty !== '')) { | ||
265 | filtercount = filtercount + 1; | 281 | filtercount = filtercount + 1; |
266 | localStorage.setItem("CICurSpeciality", query.selectedspecialty); | 282 | localStorage.setItem("CICurSpeciality", query.selectedspecialty); |
267 | } | 283 | } |
284 | + else { | ||
285 | + localStorage.setItem("CICurSpeciality", ''); | ||
286 | + } | ||
268 | 287 | ||
269 | 288 | ||
270 | var promise = DataService.getJson('~/../content/data/json/ci/ci_dat_contentlist.json') | 289 | 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 | @@ -286,7 +305,7 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout | ||
286 | var count = 0; | 305 | var count = 0; |
287 | 306 | ||
288 | 307 | ||
289 | - if (typeof (query.selectedbodyregion) !== "undefined" && (query.selectedbodyregion !== null || query.selectedbodyregion !== "null")) { | 308 | + if (typeof (query.selectedbodyregion) !== "undefined" && (query.selectedbodyregion !== null && query.selectedbodyregion !== "")) { |
290 | var posbodyregion = value._BodyRegion.indexOf((query.selectedbodyregion.trim())); | 309 | var posbodyregion = value._BodyRegion.indexOf((query.selectedbodyregion.trim())); |
291 | if (posbodyregion > -1) { | 310 | if (posbodyregion > -1) { |
292 | selectimg = true; | 311 | selectimg = true; |
@@ -300,7 +319,7 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout | @@ -300,7 +319,7 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout | ||
300 | 319 | ||
301 | } | 320 | } |
302 | 321 | ||
303 | - if (typeof (query.selectedbodysystem) !== "undefined" && (query.selectedbodysystem !== null || query.selectedbodysystem !== "null")) { | 322 | + if (typeof (query.selectedbodysystem) !== "undefined" && (query.selectedbodysystem !== null && query.selectedbodysystem !== "")) { |
304 | var posbodysystem = value._BodySystem.indexOf(query.selectedbodysystem); | 323 | var posbodysystem = value._BodySystem.indexOf(query.selectedbodysystem); |
305 | if (posbodysystem > -1) { | 324 | if (posbodysystem > -1) { |
306 | count = count + 1; | 325 | count = count + 1; |
@@ -311,7 +330,7 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout | @@ -311,7 +330,7 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout | ||
311 | } | 330 | } |
312 | } | 331 | } |
313 | 332 | ||
314 | - if (typeof (query.selectedorientation) !== "undefined" && (query.selectedorientation !== null || query.selectedorientation !== "null")) { | 333 | + if (typeof (query.selectedorientation) !== "undefined" && (query.selectedorientation !== null && query.selectedorientation !== "")) { |
315 | var posorientation = value._ViewOrientation.indexOf(query.selectedorientation); | 334 | var posorientation = value._ViewOrientation.indexOf(query.selectedorientation); |
316 | if (posorientation > -1) { | 335 | if (posorientation > -1) { |
317 | count = count + 1; | 336 | count = count + 1; |
@@ -324,7 +343,7 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout | @@ -324,7 +343,7 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout | ||
324 | 343 | ||
325 | } | 344 | } |
326 | 345 | ||
327 | - if (typeof (query.selectedimagetype) !== "undefined" && (query.selectedimagetype !== null || query.selectedimagetype !== "null")) { | 346 | + if (typeof (query.selectedimagetype) !== "undefined" && (query.selectedimagetype !== null && query.selectedimagetype !== "")) { |
328 | var posimagetype = value._ImageType.indexOf(query.selectedimagetype); | 347 | var posimagetype = value._ImageType.indexOf(query.selectedimagetype); |
329 | if (posimagetype > -1) { | 348 | if (posimagetype > -1) { |
330 | count = count + 1; | 349 | count = count + 1; |
@@ -337,7 +356,7 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout | @@ -337,7 +356,7 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout | ||
337 | 356 | ||
338 | } | 357 | } |
339 | 358 | ||
340 | - if (typeof (query.selectedspecialty) !== "undefined" && (query.selectedspecialty !== null || query.selectedspecialty !== "null")) { | 359 | + if (typeof (query.selectedspecialty) !== "undefined" && (query.selectedspecialty !== null && query.selectedspecialty !== "")) { |
341 | var posspeciality = value._MedicalSpecialty.indexOf(query.selectedspecialty); | 360 | var posspeciality = value._MedicalSpecialty.indexOf(query.selectedspecialty); |
342 | if (posspeciality > -1) { | 361 | if (posspeciality > -1) { |
343 | count = count + 1; | 362 | count = count + 1; |