Commit 1feaaddf6a8dc39a238e0ad00285582c4e816764

Authored by Mitali Srivastava
1 parent dcc1d382

Bug #5263: Maintain combo box selection after detailpage is unloaded and CI is loaded

400-SOURCECODE/AIAHTML5.Web/app/controllers/CAController.js
... ... @@ -222,18 +222,29 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, pages, B
222 222 //$('#grid-view').empty();
223 223  
224 224 filtercount = 0;
225   - if (typeof (query.selectedbodyregion) !== "undefined" && query.selectedbodyregion !== null) {
  225 + if (typeof (query.selectedbodyregion) !== "undefined" && query.selectedbodyregion !== null && query.selectedbodyregion !== "") {
226 226 filtercount = filtercount + 1;
227 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 234 filtercount = filtercount + 1;
231 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 242 filtercount = filtercount + 1;
235 243 localStorage.setItem("CACurSpeciality", query.selectedspecialty);
236 244 }
  245 + else {
  246 + localStorage.setItem("CACurSpeciality", '');
  247 + }
237 248  
238 249 var promise = DataService.getJson('~/../content/data/json/ca/ca_dat_contentlist.json')
239 250 promise.then(
... ... @@ -256,7 +267,7 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, pages, B
256 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 271 var posbodyregion = value._BodyRegion.indexOf((query.selectedbodyregion.trim()));
261 272 if (posbodyregion > -1) {
262 273 selectimg = true;
... ... @@ -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 285 var posbodysystem = value._BodySystem.indexOf(query.selectedbodysystem);
275 286 if (posbodysystem > -1) {
276 287 count = count + 1;
... ... @@ -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 296 var posspeciality = value._MedicalSpecialty.indexOf(query.selectedspecialty);
286 297 if (posspeciality > -1) {
287 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 33 // code that will be executed ...
34 34 // every time this view is loaded
35 35  
36   - $scope.LoadCIJsonData();
  36 + $scope.LoadCIJsonData();
37 37  
38 38 $scope.CIAllBodyRegion = BodyRegions;
39 39 $scope.CIAllBodySystem = BodySystems;
... ... @@ -140,7 +140,7 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout
140 140 .orderBy([{ field: '_Title', sort: 'asc' }])
141 141 .select();
142 142  
143   - //console.log($scope.selectedCIListViewData);
  143 + console.log($scope.selectedCIListViewData);
144 144 $('#grid-view').empty();
145 145 angular.forEach($scope.selectedCIListViewData, function (value, key) {
146 146 $scope.imagePath = "~/../content/images/ci/thumbnails/" + value._ThumbnailImage;
... ... @@ -245,26 +245,45 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout
245 245 //$('#grid-view').empty();
246 246  
247 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 249 filtercount = filtercount + 1;
250 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 257 filtercount = filtercount + 1;
254 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 265 filtercount = filtercount + 1;
258 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 273 filtercount = filtercount + 1;
262 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 281 filtercount = filtercount + 1;
266 282 localStorage.setItem("CICurSpeciality", query.selectedspecialty);
267 283 }
  284 + else {
  285 + localStorage.setItem("CICurSpeciality", '');
  286 + }
268 287  
269 288  
270 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 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 309 var posbodyregion = value._BodyRegion.indexOf((query.selectedbodyregion.trim()));
291 310 if (posbodyregion > -1) {
292 311 selectimg = true;
... ... @@ -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 323 var posbodysystem = value._BodySystem.indexOf(query.selectedbodysystem);
305 324 if (posbodysystem > -1) {
306 325 count = count + 1;
... ... @@ -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 334 var posorientation = value._ViewOrientation.indexOf(query.selectedorientation);
316 335 if (posorientation > -1) {
317 336 count = count + 1;
... ... @@ -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 347 var posimagetype = value._ImageType.indexOf(query.selectedimagetype);
329 348 if (posimagetype > -1) {
330 349 count = count + 1;
... ... @@ -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 360 var posspeciality = value._MedicalSpecialty.indexOf(query.selectedspecialty);
342 361 if (posspeciality > -1) {
343 362 count = count + 1;
... ...