Commit 1cc4b29341e4154b7bebda13795a270ce565df05

Authored by Mukul Rajput
1 parent 52f05f20

this is solution for the bug 29654

400-SOURCECODE/AIAHTML5.Web/app/controllers/TileViewListController.js
... ... @@ -96,19 +96,41 @@ function ($scope, $window, $rootScope, $compile, $http, $log, $location, $timeou
96 96  
97 97 $scope.FilterByImage(1, $scope.query);
98 98 setTimeout(function () {
99   - if ($rootScope.getLocalStorageValue('AAGridViewHighlightThumbnail') !== null) {
100   - $('#' + $rootScope.getLocalStorageValue("AAGridViewHighlightThumbnail")).find('.thumbnail').addClass('HightLightThumbnail');
101   - }
102   - if ($rootScope.getLocalStorageValue('AAGridViewScroll') !== null && $location.url() == "/tile-view-list") {
103   - $('html, body').animate({ scrollTop: $rootScope.getLocalStorageValue('AAGridViewScroll') }, 'slow');
  99 + if ($('#grid-view').css("display") == "block") {
  100 + if ($rootScope.getLocalStorageValue('AAGridViewHighlightThumbnail') !== null) {
  101 + $('#' + $rootScope.getLocalStorageValue("AAGridViewHighlightThumbnail")).find('.thumbnail').addClass('HightLightThumbnail');
  102 + }
  103 + if ($rootScope.getLocalStorageValue('AAGridViewScroll') !== null && $location.url() == "/tile-view-list") {
  104 +
  105 + $('html, body').animate({ scrollTop: $rootScope.getLocalStorageValue('AAGridViewScroll') }, 'slow');
  106 +
  107 + }
  108 + }
  109 + if ($('#list-view').css("display") == "block") {
104 110  
105   - }
106   - $rootScope.isLoading = false;
107   - $('#spinner').css('visibility', 'hidden');
  111 + var AAListViewScroll = $rootScope.getLocalStorageValue("AAListViewScroll");
  112 + if (typeof (AAListViewScroll) !== "undefined" && AAListViewScroll !== null && AAListViewScroll !== '' && $location.url() == "/tile-view-list") {
  113 + if (typeof InstallTrigger !== 'undefined') {
  114 +
  115 + $('#ListViewDiv').animate({ scrollTop: $rootScope.getLocalStorageValue('AAListViewScroll') }, 'slow');
  116 + }
  117 + else {
  118 +
  119 + $('#ListViewDiv').animate({ scrollTop: $rootScope.getLocalStorageValue('AAListViewScroll') }, 'slow');
  120 + }
  121 + $("#list-view table tbody tr").removeClass("active");
  122 + $("#list-view table tbody #" + $rootScope.getLocalStorageValue("listViewSelectedID")).addClass("active");
  123 + }
  124 +
  125 + }
  126 +
  127 + $rootScope.isLoading = false;
  128 + $('#spinner').css('visibility', 'hidden');
108 129 }, 100);
109 130  
110 131  
111 132 }, 100);
  133 +
112 134 //console.log(JSON.stringify(result, null, 4));
113 135 },
114 136 function (error) {
... ... @@ -160,8 +182,10 @@ function ($scope, $window, $rootScope, $compile, $http, $log, $location, $timeou
160 182 $rootScope.listArray.push({ "imageName": $rootScope.OpenItemImagePath, "text": moduleItemDataToBeSaved });
161 183 //3. set opened module item ti
162 184 localStorage.setItem("currentViewTitle", $rootScope.OpenedTileData[6]);
163   - localStorage.setItem("AAGridViewScroll", $($window).scrollTop());
164   - localStorage.setItem("AAGridViewHighlightThumbnail", $(event.target).parent().parent().parent().attr('id'));
  185 + if ($('#grid-view').css("display") == "block") {
  186 + localStorage.setItem("AAGridViewScroll", $($window).scrollTop());
  187 + localStorage.setItem("AAGridViewHighlightThumbnail", $(event.target).parent().parent().parent().attr('id'));
  188 + }
165 189  
166 190 //3. Navigate to the Module-item-view
167 191 var u = $location.url();
... ...