From 4e7c6d8ad050c98d9b6d11f81883364435edc58e Mon Sep 17 00:00:00 2001 From: mangaldeep patel Date: Tue, 15 Jan 2019 16:31:10 +0530 Subject: [PATCH] AIA BUG --- 400-SOURCECODE/AIAHTML5.Web/app/controllers/AIController.js | 49 +++++++++++++++++++++---------------------------- 1 file changed, 21 insertions(+), 28 deletions(-) diff --git a/400-SOURCECODE/AIAHTML5.Web/app/controllers/AIController.js b/400-SOURCECODE/AIAHTML5.Web/app/controllers/AIController.js index e265dbd..02747a8 100644 --- a/400-SOURCECODE/AIAHTML5.Web/app/controllers/AIController.js +++ b/400-SOURCECODE/AIAHTML5.Web/app/controllers/AIController.js @@ -20,6 +20,20 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout $scope.setActiveTab = function (tabToSet) { $scope.activeTab = tabToSet; localStorage.setItem("currentAITabView", $scope.activeTab); + if (tabToSet == 2) { + var curSelectedRowId = $rootScope.getLocalStorageValue("AISelectedRowId"); + $('#' + $rootScope.getLocalStorageValue("currentAIImageId")).addClass("selected"); + $scope.idSelected = $rootScope.getLocalStorageValue("currentAIImageId"); + var selectedImageId = $rootScope.getLocalStorageValue("currentAIImageId"); + $scope.LoadAIJsonData(); + $scope.ReloadListViewImageDiv(selectedImageId); + $scope.showItem(selectedImageId); + } + else { + $('#' + $rootScope.getLocalStorageValue("currentAIImageId")).find('.thumbnail').addClass('HightLightThumbnail'); + $('#' + $rootScope.getLocalStorageValue("currentAIImageId")).removeClass('selected'); + $scope.loadAllAI(); + } }; $scope.$on('$viewContentLoaded', function (event) { @@ -49,7 +63,7 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout //set the local storage var curtab = $rootScope.getLocalStorageValue("currentAITabView"); - if (curtab == 2) { + if (curtab == 2) { $scope.setActiveTab(2); var curSelectedRowId = $rootScope.getLocalStorageValue("AISelectedRowId"); if (typeof (curSelectedRowId) !== "undefined" && curSelectedRowId !== null && curSelectedRowId !== '') { @@ -214,9 +228,6 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout $scope.Reset = function (query) { $('ul li a').removeAttr("style"); query.SearchText = ""; - - - //set localstorage values localStorage.setItem("SearchText", ''); localStorage.setItem("SearchByAlphabet", ''); @@ -252,25 +263,17 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout $rootScope.isLoading = true; $('#spinner').css('visibility', 'visible'); - - $scope.filterstring = true; while ($scope.searchAIListViewData.length) { $scope.searchAIListViewData.pop(); } - - - if (typeof (query.SearchText) !== "undefined" && (query.SearchText !== null && query.SearchText !== "")) { - localStorage.setItem("SearchText", query.SearchText); - } else { localStorage.setItem("SearchText", ''); - } var promise = DataService.getJson('~/../content/data/json/ai/ai_dat_contentlist.json') @@ -295,13 +298,11 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout if (posbodyregion > -1) { selectimg = true; //count = count + 1; - } else { selectimg = false; //count = count - 1; } - } if (selectimg === true) { @@ -319,8 +320,6 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout autoHideScrollbar: true, //theme:"rounded" }); - - $scope.searchAIListViewData.push( { "_id": value._id, @@ -328,8 +327,6 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout "_Title": value._Title, "_contentImage": value._contentImage, "_ThumbnailImage": value._ThumbnailImage, - - }); } }); @@ -414,13 +411,10 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout $compile($el)($scope); - $(".sidebar").mCustomScrollbar({ autoHideScrollbar: true, //theme:"rounded" }); - - $scope.searchAIListViewData.push( { "_id": value._id, @@ -428,8 +422,6 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout "_Title": value._Title, "_contentImage": value._contentImage, "_ThumbnailImage": value._ThumbnailImage, - - }); } }); @@ -594,6 +586,9 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout //console.log(id); $scope.idSelected = id; $scope.hiderow = true; + $rootScope.isLoading = true; + $('#aiSpinner').css('visibility', 'visible'); + $('#aiSpinner').css('zIndex', '20000'); var promise = DataService.getJson('~/../content/data/json/ai/ai_dat_contentlist.json') promise.then( @@ -618,11 +613,12 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout $('#ListViewDiv').animate({ scrollTop: $rootScope.getLocalStorageValue("AIListViewScroll") }); } else { - $('#ListViewDiv').scrollTop($rootScope.getLocalStorageValue("AIListViewScroll")); + $('#ListViewDiv').scrollTop($rootScope.getLocalStorageValue("AIListViewScroll")); } } - + $rootScope.isLoading = false; + $('#aiSpinner').css('visibility', 'hidden'); }, function (error) { // handle errors here @@ -638,9 +634,6 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout $scope.hiderow = false; } } - - - }] ); -- libgit2 0.21.4