Commit 5cd9732621746b1afe46146cc8bbba0f3d2a5e69
1 parent
89bf88dc
serachByAlphabetFixed
Showing
1 changed file
with
19 additions
and
11 deletions
400-SOURCECODE/AIAHTML5.Web/app/controllers/AIController.js
@@ -325,12 +325,15 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout | @@ -325,12 +325,15 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout | ||
325 | $scope.Reset = function (query) { | 325 | $scope.Reset = function (query) { |
326 | $('ul li span').removeAttr("style"); | 326 | $('ul li span').removeAttr("style"); |
327 | query.SearchText = ""; | 327 | query.SearchText = ""; |
328 | + $scope.idSelected = ''; | ||
328 | //set localstorage values | 329 | //set localstorage values |
329 | localStorage.setItem("SearchText", ''); | 330 | localStorage.setItem("SearchText", ''); |
330 | localStorage.setItem("SearchByAlphabet", ''); | 331 | localStorage.setItem("SearchByAlphabet", ''); |
331 | localStorage.setItem("AIListViewScroll", ''); | 332 | localStorage.setItem("AIListViewScroll", ''); |
332 | var ImageCount = $rootScope.getLocalStorageValue("ImageCount"); | 333 | var ImageCount = $rootScope.getLocalStorageValue("ImageCount"); |
333 | - if ($('.selected').hasClass("selected")) { $('.selected').removeClass("selected"); } | 334 | + if ($('.selected').hasClass("selected")) { |
335 | + $('.selected').removeClass("selected"); | ||
336 | + } | ||
334 | 337 | ||
335 | $('#ListViewDiv').scrollTop(0); | 338 | $('#ListViewDiv').scrollTop(0); |
336 | 339 | ||
@@ -345,6 +348,8 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout | @@ -345,6 +348,8 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout | ||
345 | 348 | ||
346 | $scope.ApplySearch = function (query) { | 349 | $scope.ApplySearch = function (query) { |
347 | $('ul li span').removeAttr("style"); | 350 | $('ul li span').removeAttr("style"); |
351 | + $scope.idSelected = ''; | ||
352 | + $scope.hiderow = false; | ||
348 | var currentSearchtext = $rootScope.getLocalStorageValue("SearchText"); | 353 | var currentSearchtext = $rootScope.getLocalStorageValue("SearchText"); |
349 | localStorage.setItem("SearchText", ''); | 354 | localStorage.setItem("SearchText", ''); |
350 | if (currentSearchtext == "undefined" || (currentSearchtext == null || currentSearchtext == "")) { | 355 | if (currentSearchtext == "undefined" || (currentSearchtext == null || currentSearchtext == "")) { |
@@ -354,11 +359,13 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout | @@ -354,11 +359,13 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout | ||
354 | return false; | 359 | return false; |
355 | } | 360 | } |
356 | } | 361 | } |
362 | + | ||
357 | 363 | ||
364 | + //$scope.filterstring = false; | ||
358 | while ($scope.searchAIListViewData.length) { | 365 | while ($scope.searchAIListViewData.length) { |
359 | $scope.searchAIListViewData.pop(); | 366 | $scope.searchAIListViewData.pop(); |
360 | } | 367 | } |
361 | - | 368 | + |
362 | $rootScope.isLoading = true; | 369 | $rootScope.isLoading = true; |
363 | $('#aiSpinner').css('visibility', 'visible'); | 370 | $('#aiSpinner').css('visibility', 'visible'); |
364 | $scope.DisableUI(); | 371 | $scope.DisableUI(); |
@@ -455,13 +462,20 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout | @@ -455,13 +462,20 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout | ||
455 | } | 462 | } |
456 | $scope.counter = 1; | 463 | $scope.counter = 1; |
457 | $scope.ApplySearchByAlphabet = function (SearchTextByAlphabet) { | 464 | $scope.ApplySearchByAlphabet = function (SearchTextByAlphabet) { |
458 | - $rootScope.SearchTextByAlphabet = SearchTextByAlphabet | 465 | + $rootScope.SearchTextByAlphabet = SearchTextByAlphabet; |
466 | + localStorage.setItem("SearchByAlphabet", ''); | ||
459 | $rootScope.isLoading = true; | 467 | $rootScope.isLoading = true; |
468 | + $scope.idSelected = ''; | ||
469 | + $scope.hiderow = false; | ||
460 | $('#aiSpinner').css('visibility', 'visible'); | 470 | $('#aiSpinner').css('visibility', 'visible'); |
461 | $scope.DisableUI(); | 471 | $scope.DisableUI(); |
462 | $('ul li span').removeAttr("style"); | 472 | $('ul li span').removeAttr("style"); |
463 | $('#' + $rootScope.SearchTextByAlphabet).css({ "color": "white", "background-color": "#1B92D0" }); | 473 | $('#' + $rootScope.SearchTextByAlphabet).css({ "color": "white", "background-color": "#1B92D0" }); |
464 | $scope.filterstring = true; | 474 | $scope.filterstring = true; |
475 | + while ($scope.searchAIListViewData.length) { | ||
476 | + $scope.searchAIListViewData.pop(); | ||
477 | + } | ||
478 | + | ||
465 | if (typeof (SearchTextByAlphabet) !== "undefined" && (SearchTextByAlphabet !== null && SearchTextByAlphabet !== "")) { | 479 | if (typeof (SearchTextByAlphabet) !== "undefined" && (SearchTextByAlphabet !== null && SearchTextByAlphabet !== "")) { |
466 | localStorage.setItem("SearchByAlphabet", SearchTextByAlphabet); | 480 | localStorage.setItem("SearchByAlphabet", SearchTextByAlphabet); |
467 | } | 481 | } |
@@ -510,6 +524,7 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout | @@ -510,6 +524,7 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout | ||
510 | "_contentImage": value._contentImage, | 524 | "_contentImage": value._contentImage, |
511 | "_ThumbnailImage": value._ThumbnailImage, | 525 | "_ThumbnailImage": value._ThumbnailImage, |
512 | }); | 526 | }); |
527 | + | ||
513 | } | 528 | } |
514 | 529 | ||
515 | }); | 530 | }); |
@@ -523,7 +538,7 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout | @@ -523,7 +538,7 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout | ||
523 | $('#ListViewDiv').append('<tr id="searchItem"><td colspan="6"><strong style="color:black;">No illustration found for the selected search criteria!</strong></td></tr>'); | 538 | $('#ListViewDiv').append('<tr id="searchItem"><td colspan="6"><strong style="color:black;">No illustration found for the selected search criteria!</strong></td></tr>'); |
524 | } | 539 | } |
525 | $rootScope.isLoading = false; | 540 | $rootScope.isLoading = false; |
526 | - | 541 | + |
527 | setTimeout(function () { | 542 | setTimeout(function () { |
528 | $scope.EnableUI(); | 543 | $scope.EnableUI(); |
529 | }, 10); | 544 | }, 10); |
@@ -531,10 +546,7 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout | @@ -531,10 +546,7 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout | ||
531 | function (error) { | 546 | function (error) { |
532 | console.log(' $scope.IllustrationData = ' + error.statusText); | 547 | console.log(' $scope.IllustrationData = ' + error.statusText); |
533 | } | 548 | } |
534 | - | ||
535 | ); | 549 | ); |
536 | - | ||
537 | - | ||
538 | } | 550 | } |
539 | 551 | ||
540 | 552 | ||
@@ -645,10 +657,6 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout | @@ -645,10 +657,6 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout | ||
645 | $("#aiImagePanel .img-thumbnail").css("min-height", $("#aiImagePanel .jsPanel-content").height()); | 657 | $("#aiImagePanel .img-thumbnail").css("min-height", $("#aiImagePanel .jsPanel-content").height()); |
646 | $('.jsPanel-content .jsPanel-theme-success').css('overflow-y', 'auto !important') | 658 | $('.jsPanel-content .jsPanel-theme-success').css('overflow-y', 'auto !important') |
647 | var jspContentHeight = $('.jsPanel-content').height(); | 659 | var jspContentHeight = $('.jsPanel-content').height(); |
648 | - | ||
649 | - | ||
650 | - | ||
651 | - | ||
652 | } | 660 | } |
653 | }, | 661 | }, |
654 | function (error) { | 662 | function (error) { |