diff --git a/400-SOURCECODE/AIAHTML5.Web/app/controllers/AIController.js b/400-SOURCECODE/AIAHTML5.Web/app/controllers/AIController.js index ce4cbf3..f123574 100644 --- a/400-SOURCECODE/AIAHTML5.Web/app/controllers/AIController.js +++ b/400-SOURCECODE/AIAHTML5.Web/app/controllers/AIController.js @@ -21,85 +21,11 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout localStorage.setItem("ImageCount", Count); var searchByText = $rootScope.getLocalStorageValue("SearchText"); var searchTextByAlphabet = $rootScope.getLocalStorageValue("SearchByAlphabet"); - var SelectCurrTab = $rootScope.getLocalStorageValue("currentAITabView"); - - //Commented by sandeep for fixed bugs related to ADAM Images - //$timeout(function () { - // $("#ListViewDiv").on('scroll', function () { - - // var searchByText = $rootScope.getLocalStorageValue("SearchText"); - // var searchTextByAlphabet = $rootScope.getLocalStorageValue("SearchByAlphabet"); - // var SelectCurrTab = $rootScope.getLocalStorageValue("currentAITabView"); - // if ($scope.query.SelectedDiv == 2) { - - // if ($(this).scrollTop() + $(this).innerHeight() >= $(this)[0].scrollHeight - 10) { - // Count += 100; - // //$(window).scrollTop(0); - // var ImageCount = $rootScope.getLocalStorageValue("ImageCount"); - // if (typeof (searchByText) !== "undefined" && searchByText !== null && searchByText !== '') { - // $scope.query.SearchText = searchByText; - // } - // else if (typeof (searchTextByAlphabet) !== "undefined" && searchTextByAlphabet !== null && searchTextByAlphabet !== '') { - // $scope.query.SearchTextByAlphabet = searchTextByAlphabet; - // } - // else { - // $scope.query.SearchTextByAlphabet = ""; - // } - - // if ($scope.query.SearchText == "" && $scope.query.SearchTextByAlphabet == "") { - - // $scope.LoadAIJsonData(Count); - // $scope.loadAllAI(Count); - // } - // else if ($scope.query.SearchTextByAlphabet != "" || $scope.query.SearchText == "") { - // $scope.ApplySearchByAlphabet($scope.query.SearchTextByAlphabet); - // } - // else { - // $scope.ApplySearch($scope.query); - // } - // } - // } - // }); - - //}, 10); - - //$(window).scroll(function () { - // var searchByText = $rootScope.getLocalStorageValue("SearchText"); - // var searchTextByAlphabet = $rootScope.getLocalStorageValue("SearchByAlphabet"); - // var SelectCurrTab = $rootScope.getLocalStorageValue("currentAITabView"); - // if ($scope.query.SelectedDiv == 1) { - - // if ($(window).scrollTop() == $(document).height() - $(window).height()) { - // Count += 100; - // var ImageCount = $rootScope.getLocalStorageValue("ImageCount"); - // if (typeof (searchByText) !== "undefined" && searchByText !== null && searchByText !== '') { - // $scope.query.SearchText = searchByText; - // } - // else if (typeof (searchTextByAlphabet) !== "undefined" && searchTextByAlphabet !== null && searchTextByAlphabet !== '') { - // $scope.query.SearchTextByAlphabet = searchTextByAlphabet; - // } - // else { - // $scope.query.SearchTextByAlphabet = ""; - // } - - // if ($scope.query.SearchText == "" && $scope.query.SearchTextByAlphabet == "") { - - // $scope.LoadAIJsonData(Count); - // $scope.loadAllAI(Count); - // } - // else if ($scope.query.SearchTextByAlphabet != "" || $scope.query.SearchText == "") { - // $scope.ApplySearchByAlphabet($scope.query.SearchTextByAlphabet); - // } - // else { - // $scope.ApplySearch($scope.query); - // } - // } - // } - //}); + var SelectCurrTab = $rootScope.getLocalStorageValue("currentAITabView"); - + //Modified code by sandeep for fixed Bugs of ADAM Images $scope.setActiveTab = function (tabToSet, inderectCall) { - //Modified code by sandeep for fixed Bugs of ADAM Images + $scope.activeTab = tabToSet; localStorage.setItem("currentAITabView", ""); localStorage.setItem("currentAITabView", $scope.activeTab); @@ -139,14 +65,12 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout $scope.filterstring = false; $scope.showItem(selectedImageId); $scope.filterstring = true; - } - //$scope.ReloadListViewImageDiv(curSelectedRowId, ImageCount); + } } } - else { - //ReloadListViewImageDiv(curSelectedRowId, ImageCount); - $scope.loadAllAI(ImageCount); - if (inderectCall == true) { + else { + $scope.loadAllAI(ImageCount); + if (inderectCall == true) { if (curSelectedRowId != "") { $scope.filterstring = true; $scope.showItem(curSelectedRowId); @@ -156,13 +80,11 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout if (selectedImageId != "") { $scope.filterstring = false; $scope.showItem(selectedImageId); - } - //$scope.ReloadListViewImageDiv(curSelectedRowId, ImageCount); + } } } $scope.query.SelectedDiv = tabToSet; - //Method call for set position for selected title Bug-57978 - //$scope.ReloadListViewImageDiv(curSelectedRowId, ImageCount); + //Method call for set position for selected title Bug-57978 $('#grid-view').css("display", "none"); $('#list-view').css("display", "block"); } @@ -191,60 +113,14 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout }, 100); }; - - - //$scope.loadAIModuleById = function (moduleId) { - - // var ImageCount = $rootScope.getLocalStorageValue("ImageCount"); - - // if ($rootScope.refreshcheck == null) { - // $location.path('/'); - // } - - // // code that will be executed ... - // // every time this view is loaded - - // //get current path - // var currentURL = $location.path(); - // var selectedModuleName = ''; - // //set module title - // angular.forEach($rootScope.userModules, function (value, key) { - // if (value.slug === currentURL.replace('/', '')) { - // selectedModuleName = value.name; - // } - // $rootScope.currentActiveModuleTitle = selectedModuleName; - // }) - - // $scope.LoadAIJsonData(ImageCount); - // $scope.scroll(); - // //push the details of open module in array $rootScope.openModules - // $rootScope.openModules.push({ "ModuleId": 13 }); - - // //set the local storage - // var curtab = $rootScope.getLocalStorageValue("currentAITabView"); - // var inderectCall = true; - // if (curtab == 2) { - // $scope.setActiveTab(2, inderectCall); - // var curSelectedRowId = $rootScope.getLocalStorageValue("AISelectedRowId"); - // if (typeof (curSelectedRowId) !== "undefined" && curSelectedRowId !== null && curSelectedRowId !== '') { - // $scope.reRunSearchOnLoad(); - // $scope.idSelected = curSelectedRowId; - // $scope.ReloadListViewImageDiv($scope.idSelected, ImageCount); - // } - // else { - // $scope.reRunSearchOnLoad() - // $scope.idSelected = ''; - // } - // } - // else { - // $scope.setActiveTab(1, inderectCall); - // $scope.reRunSearchOnLoad(); - - // } - //} - + $scope.loadAIModuleById = function (moduleId) { - + + if ($rootScope.checkRefreshButtonClick == 1) { + var query = $scope.query; + $scope.Reset(query); + $rootScope.checkRefreshButtonClick = 0; + } var ImageCount = $rootScope.getLocalStorageValue("ImageCount"); if ($rootScope.refreshcheck == null) { @@ -309,10 +185,10 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout $scope.query.SearchTextByAlphabet = ""; } - if ($scope.query.SearchText == "" && $scope.query.SearchTextByAlphabet == "") { + //if ($scope.query.SearchText == "" && $scope.query.SearchTextByAlphabet == "") { - $scope.loadAllAI(ImageCount); - } + // $scope.loadAllAI(ImageCount); + //} } @@ -353,12 +229,11 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout $scope.selectedAIListViewData = new jinqJs() .from($scope.IllustrationData.root.AIData) .orderBy([{ field: '_Title', sort: 'asc' }]) - .select().slice(0, ImageCount); + //.select().slice(0, ImageCount); + .select(); //Fixed Bug-58419 by Sandeep //console.log($scope.selectedAIListViewData); - - $('#grid-view').empty(); var $e1 = $('