diff --git a/400-SOURCECODE/AIAHTML5.Web/app/controllers/AIController.js b/400-SOURCECODE/AIAHTML5.Web/app/controllers/AIController.js index fe9dfdd..cada18c 100644 --- a/400-SOURCECODE/AIAHTML5.Web/app/controllers/AIController.js +++ b/400-SOURCECODE/AIAHTML5.Web/app/controllers/AIController.js @@ -325,12 +325,15 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout $scope.Reset = function (query) { $('ul li span').removeAttr("style"); query.SearchText = ""; + $scope.idSelected = ''; //set localstorage values localStorage.setItem("SearchText", ''); localStorage.setItem("SearchByAlphabet", ''); localStorage.setItem("AIListViewScroll", ''); var ImageCount = $rootScope.getLocalStorageValue("ImageCount"); - if ($('.selected').hasClass("selected")) { $('.selected').removeClass("selected"); } + if ($('.selected').hasClass("selected")) { + $('.selected').removeClass("selected"); + } $('#ListViewDiv').scrollTop(0); @@ -345,6 +348,8 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout $scope.ApplySearch = function (query) { $('ul li span').removeAttr("style"); + $scope.idSelected = ''; + $scope.hiderow = false; var currentSearchtext = $rootScope.getLocalStorageValue("SearchText"); localStorage.setItem("SearchText", ''); if (currentSearchtext == "undefined" || (currentSearchtext == null || currentSearchtext == "")) { @@ -354,11 +359,13 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout return false; } } + + //$scope.filterstring = false; while ($scope.searchAIListViewData.length) { $scope.searchAIListViewData.pop(); } - + $rootScope.isLoading = true; $('#aiSpinner').css('visibility', 'visible'); $scope.DisableUI(); @@ -455,13 +462,20 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout } $scope.counter = 1; $scope.ApplySearchByAlphabet = function (SearchTextByAlphabet) { - $rootScope.SearchTextByAlphabet = SearchTextByAlphabet + $rootScope.SearchTextByAlphabet = SearchTextByAlphabet; + localStorage.setItem("SearchByAlphabet", ''); $rootScope.isLoading = true; + $scope.idSelected = ''; + $scope.hiderow = false; $('#aiSpinner').css('visibility', 'visible'); $scope.DisableUI(); $('ul li span').removeAttr("style"); $('#' + $rootScope.SearchTextByAlphabet).css({ "color": "white", "background-color": "#1B92D0" }); $scope.filterstring = true; + while ($scope.searchAIListViewData.length) { + $scope.searchAIListViewData.pop(); + } + if (typeof (SearchTextByAlphabet) !== "undefined" && (SearchTextByAlphabet !== null && SearchTextByAlphabet !== "")) { localStorage.setItem("SearchByAlphabet", SearchTextByAlphabet); } @@ -510,6 +524,7 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout "_contentImage": value._contentImage, "_ThumbnailImage": value._ThumbnailImage, }); + } }); @@ -523,7 +538,7 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout $('#ListViewDiv').append('No illustration found for the selected search criteria!'); } $rootScope.isLoading = false; - + setTimeout(function () { $scope.EnableUI(); }, 10); @@ -531,10 +546,7 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout function (error) { console.log(' $scope.IllustrationData = ' + error.statusText); } - ); - - } @@ -645,10 +657,6 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout $("#aiImagePanel .img-thumbnail").css("min-height", $("#aiImagePanel .jsPanel-content").height()); $('.jsPanel-content .jsPanel-theme-success').css('overflow-y', 'auto !important') var jspContentHeight = $('.jsPanel-content').height(); - - - - } }, function (error) {