Commit 865d88396da3b9a6512066d3d2cb4a581349b373

Authored by unknown
1 parent 337a8b1f

25270 : Atlas Anatomy > Thumbnail filter state is not maintained.(win)

400-SOURCECODE/AIAHTML5.Web/app/controllers/TileViewListController.js
... ... @@ -55,6 +55,7 @@ function ($scope, $window, $rootScope, $compile, $http, $log, $location, $timeou
55 55 };
56 56  
57 57 $scope.loadForModuleById = function (moduleId) {
  58 +
58 59 $rootScope.openModules.push({ "ModuleId": 2 });
59 60 if ($rootScope.refreshcheck == null) {
60 61 $location.path('/');
... ... @@ -75,12 +76,35 @@ function ($scope, $window, $rootScope, $compile, $http, $log, $location, $timeou
75 76 $scope.moduleLandingData = result;
76 77 // setTimeout(function () { $('#' + $rootScope.highlightid).find('.thumbnail').addClass('hightlightstate'); }, 100);
77 78 setTimeout(function () {
  79 +
  80 + if (localStorage.getItem("CurrentBodyRegion") != '') {
  81 + $("#region option[value='"+localStorage.getItem('CurrentBodyRegion')+"']").prop('selected', true);
  82 + }
  83 + if (localStorage.getItem("CurrentBodySystem") != '') {
  84 + $("#system option[value='"+localStorage.getItem('CurrentBodySystem')+"']").prop('selected', true);
  85 + }
  86 + if (localStorage.getItem("CurrentOrientation") != '') {
  87 + $("#orientation option[value='"+localStorage.getItem('CurrentOrientation')+"']").prop('selected', true);
  88 + }
  89 + if (localStorage.getItem("CurrentImageType") != '') {
  90 + $("#Type option[value='"+localStorage.getItem('CurrentImageType')+"']").prop('selected', true);
  91 + }
  92 + $scope.query.selectedbodyregion = localStorage.getItem('CurrentBodyRegion');
  93 + $scope.query.selectedbodysystem = localStorage.getItem('CurrentBodySystem');
  94 + $scope.query.selectedorientation = localStorage.getItem('CurrentOrientation');
  95 + $scope.query.selectedimagetype = localStorage.getItem('CurrentImageType');
  96 +
  97 + $scope.FilterByImage(1, $scope.query);
  98 + setTimeout(function () {
78 99 if ($rootScope.getLocalStorageValue('AAGridViewHighlightThumbnail') !== null) {
79 100 $('#' + $rootScope.getLocalStorageValue("AAGridViewHighlightThumbnail")).find('.thumbnail').addClass('HightLightThumbnail');
80 101 }
81 102 if ($rootScope.getLocalStorageValue('AAGridViewScroll') !== null && $location.url() == "/tile-view-list") {
82 103 $('html, body').animate({ scrollTop: $rootScope.getLocalStorageValue('AAGridViewScroll') }, 'slow');
83 104 }
  105 + }, 100);
  106 +
  107 +
84 108 }, 100);
85 109 //console.log(JSON.stringify(result, null, 4));
86 110 },
... ... @@ -135,7 +159,7 @@ function ($scope, $window, $rootScope, $compile, $http, $log, $location, $timeou
135 159 localStorage.setItem("currentViewTitle", $rootScope.OpenedTileData[6]);
136 160 localStorage.setItem("AAGridViewScroll", $($window).scrollTop());
137 161 localStorage.setItem("AAGridViewHighlightThumbnail", $(event.target).parent().parent().parent().attr('id'));
138   -
  162 +
139 163 //3. Navigate to the Module-item-view
140 164 var u = $location.url();
141 165 $location.url('/module-item-view');
... ... @@ -479,6 +503,8 @@ function ($scope, $window, $rootScope, $compile, $http, $log, $location, $timeou
479 503  
480 504  
481 505 $scope.FilterByImage = function (moduleId, query) {
  506 + debugger;
  507 + console.log(query);
482 508 $scope.moduleId = moduleId;
483 509 $scope.filterstring = true;
484 510  
... ... @@ -595,9 +621,9 @@ function ($scope, $window, $rootScope, $compile, $http, $log, $location, $timeou
595 621 $scope.imagePath = "../content/images/aa/thumbnails/" + value._TileImageName;
596 622  
597 623  
598   - var $el = $('<div id="' + value._Title + '" class="col-sm-3 col-lg-2" title = "' + value._Title + '" data-ng-click="openModuleItemView($event)">'
  624 + var $el = $('<div id="' + value._Id + '" class="col-sm-3 col-lg-2" title = "' + value._Title + '" data-ng-click="openModuleItemView($event)">'
599 625 + '<div class="thumbnail" ><a href="#">'
600   - + '<img class="tinyImg" id="' + value._Title + '"ng-src="' + $scope.imagePath + '" alt="" title="" >'
  626 + + '<img class="tinyImg" id="' + value._Title + '" ng-src="' + $scope.imagePath + '" alt="" title="" >'
601 627 + '<div class="caption"><p>' + value._Title + '</p></div></a></div></div>').appendTo('#grid-view');
602 628  
603 629  
... ... @@ -648,7 +674,7 @@ function ($scope, $window, $rootScope, $compile, $http, $log, $location, $timeou
648 674 }
649 675  
650 676 $scope.Reset = function (moduleId, query) {
651   -
  677 + debugger;
652 678 query.selectedbodyregion = "";
653 679 query.selectedbodysystem = "";
654 680 query.selectedorientation = "";
... ...