diff --git a/400-SOURCECODE/AIAHTML5.Web/app/controllers/TileViewListController.js b/400-SOURCECODE/AIAHTML5.Web/app/controllers/TileViewListController.js index 0d34178..5c465f4 100644 --- a/400-SOURCECODE/AIAHTML5.Web/app/controllers/TileViewListController.js +++ b/400-SOURCECODE/AIAHTML5.Web/app/controllers/TileViewListController.js @@ -96,19 +96,41 @@ function ($scope, $window, $rootScope, $compile, $http, $log, $location, $timeou $scope.FilterByImage(1, $scope.query); setTimeout(function () { - if ($rootScope.getLocalStorageValue('AAGridViewHighlightThumbnail') !== null) { - $('#' + $rootScope.getLocalStorageValue("AAGridViewHighlightThumbnail")).find('.thumbnail').addClass('HightLightThumbnail'); - } - if ($rootScope.getLocalStorageValue('AAGridViewScroll') !== null && $location.url() == "/tile-view-list") { - $('html, body').animate({ scrollTop: $rootScope.getLocalStorageValue('AAGridViewScroll') }, 'slow'); + if ($('#grid-view').css("display") == "block") { + if ($rootScope.getLocalStorageValue('AAGridViewHighlightThumbnail') !== null) { + $('#' + $rootScope.getLocalStorageValue("AAGridViewHighlightThumbnail")).find('.thumbnail').addClass('HightLightThumbnail'); + } + if ($rootScope.getLocalStorageValue('AAGridViewScroll') !== null && $location.url() == "/tile-view-list") { + + $('html, body').animate({ scrollTop: $rootScope.getLocalStorageValue('AAGridViewScroll') }, 'slow'); + + } + } + if ($('#list-view').css("display") == "block") { - } - $rootScope.isLoading = false; - $('#spinner').css('visibility', 'hidden'); + var AAListViewScroll = $rootScope.getLocalStorageValue("AAListViewScroll"); + if (typeof (AAListViewScroll) !== "undefined" && AAListViewScroll !== null && AAListViewScroll !== '' && $location.url() == "/tile-view-list") { + if (typeof InstallTrigger !== 'undefined') { + + $('#ListViewDiv').animate({ scrollTop: $rootScope.getLocalStorageValue('AAListViewScroll') }, 'slow'); + } + else { + + $('#ListViewDiv').animate({ scrollTop: $rootScope.getLocalStorageValue('AAListViewScroll') }, 'slow'); + } + $("#list-view table tbody tr").removeClass("active"); + $("#list-view table tbody #" + $rootScope.getLocalStorageValue("listViewSelectedID")).addClass("active"); + } + + } + + $rootScope.isLoading = false; + $('#spinner').css('visibility', 'hidden'); }, 100); }, 100); + //console.log(JSON.stringify(result, null, 4)); }, function (error) { @@ -160,8 +182,10 @@ function ($scope, $window, $rootScope, $compile, $http, $log, $location, $timeou $rootScope.listArray.push({ "imageName": $rootScope.OpenItemImagePath, "text": moduleItemDataToBeSaved }); //3. set opened module item ti localStorage.setItem("currentViewTitle", $rootScope.OpenedTileData[6]); - localStorage.setItem("AAGridViewScroll", $($window).scrollTop()); - localStorage.setItem("AAGridViewHighlightThumbnail", $(event.target).parent().parent().parent().attr('id')); + if ($('#grid-view').css("display") == "block") { + localStorage.setItem("AAGridViewScroll", $($window).scrollTop()); + localStorage.setItem("AAGridViewHighlightThumbnail", $(event.target).parent().parent().parent().attr('id')); + } //3. Navigate to the Module-item-view var u = $location.url();