Commit 2d959528bc6ef2193ad3d33bf5ef734de056abc8

Authored by Nikita Kulshreshtha
2 parents 96f40699 89bf88dc

Merge branch 'AIA_BUGS' into Develop

400-SOURCECODE/AIAHTML5.Web/app/controllers/AIController.js
... ... @@ -15,17 +15,21 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout
15 15 $scope.query = {
16 16 SearchText: '',
17 17 SearchTextByAlphabet: '',
  18 + SelectedDiv: ''
18 19 };
  20 + var Count = 200;
  21 + localStorage.setItem("ImageCount", Count);
  22 + var searchByText = $rootScope.getLocalStorageValue("SearchText");
  23 + var searchTextByAlphabet = $rootScope.getLocalStorageValue("SearchByAlphabet");
  24 + var SelectCurrTab = $rootScope.getLocalStorageValue("currentAITabView");
  25 +
  26 + $timeout(function () {
  27 + $("#ListViewDiv").on('scroll', function () {
  28 + if ($scope.query.SelectedDiv == 2) {
19 29  
20   - $(document).ready(function () {
21   - $timeout(function () {
22   - var Count = 200;
23   - localStorage.setItem("ImageCount", Count);
24   - var searchByText = $rootScope.getLocalStorageValue("SearchText");
25   - var searchTextByAlphabet = $rootScope.getLocalStorageValue("SearchByAlphabet");
26   - $("#ListViewDiv").on('scroll', function () {
27 30 if ($(this).scrollTop() + $(this).innerHeight() >= $(this)[0].scrollHeight - 10) {
28 31 Count += 100;
  32 + //$(window).scrollTop(0);
29 33 var ImageCount = $rootScope.getLocalStorageValue("ImageCount");
30 34 if (typeof (searchByText) !== "undefined" && searchByText !== null && searchByText !== '') {
31 35 $scope.query.SearchText = searchByText;
... ... @@ -49,16 +53,13 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout
49 53 $scope.ApplySearch($scope.query);
50 54 }
51 55 }
52   - });
53   - }, 10);
54   - });
  56 + }
  57 + });
55 58  
56   - $(document).ready(function () {
57   - var Count = 200;
58   - localStorage.setItem("ImageCount", Count);
59   - var searchByText = $rootScope.getLocalStorageValue("SearchText");
60   - var searchTextByAlphabet = $rootScope.getLocalStorageValue("SearchByAlphabet");
61   - $(window).scroll(function () {
  59 + }, 10);
  60 +
  61 + $(window).scroll(function () {
  62 + if ($scope.query.SelectedDiv == 1) {
62 63 if ($(window).scrollTop() == $(document).height() - $(window).height()) {
63 64 Count += 100;
64 65 var ImageCount = $rootScope.getLocalStorageValue("ImageCount");
... ... @@ -84,25 +85,40 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout
84 85 $scope.ApplySearch($scope.query);
85 86 }
86 87 }
87   - });
88   -
  88 + }
89 89 });
90 90  
  91 +
91 92 $scope.setActiveTab = function (tabToSet) {
92 93 $scope.activeTab = tabToSet;
93 94 localStorage.setItem("currentAITabView", $scope.activeTab);
94 95 var ImageCount = $rootScope.getLocalStorageValue("ImageCount");
  96 + var searchText = $rootScope.getLocalStorageValue("SearchText");
95 97 if (tabToSet == 2) {
96 98 var curSelectedRowId = $rootScope.getLocalStorageValue("AISelectedRowId");
97 99 $('#' + $rootScope.getLocalStorageValue("currentAIImageId")).addClass("selected");
98 100 $scope.idSelected = $rootScope.getLocalStorageValue("currentAIImageId");
99 101 var selectedImageId = $rootScope.getLocalStorageValue("currentAIImageId");
100   - $scope.ReloadListViewImageDiv(selectedImageId, ImageCount);
  102 + if (searchText != '') {
  103 + $scope.ApplySearch(searchText);
  104 + }
  105 + else {
  106 + $scope.ReloadListViewImageDiv(selectedImageId, ImageCount);
  107 + }
  108 +
  109 + $scope.query.SelectedDiv = tabToSet;
101 110 }
102 111 else {
103 112 $('#' + $rootScope.getLocalStorageValue("currentAIImageId")).find('.thumbnail').addClass('HightLightThumbnail');
104 113 $('#' + $rootScope.getLocalStorageValue("currentAIImageId")).removeClass('selected');
105   - $scope.loadAllAI(ImageCount);
  114 + $scope.query.SelectedDiv = tabToSet;
  115 + if (searchText != '') {
  116 + $scope.ApplySearch(searchText);
  117 + }
  118 + else {
  119 + $scope.loadAllAI(ImageCount);
  120 + }
  121 +
106 122 }
107 123 };
108 124  
... ... @@ -202,8 +218,6 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout
202 218 console.log(' $scope.IllustrationData = ' + error.statusText);
203 219 }
204 220 );
205   -
206   -
207 221 };
208 222  
209 223 $scope.loadAllAI = function (ImageCount) {
... ... @@ -239,8 +253,8 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout
239 253  
240 254 $timeout(function () {
241 255 $('#' + $rootScope.getLocalStorageValue("currentAIImageId")).find('.thumbnail').addClass('HightLightThumbnail');
242   - if ($rootScope.getLocalStorageValue('AIGridViewScroll') !== null && $location.url() == "/ADAM-images") {
243   - //$('html, body').animate({ scrollTop: $rootScope.getLocalStorageValue('AIGridViewScroll') });
  256 + if ($rootScope.getLocalStorageValue('AIGridViewScroll') !== null && $location.url() == "/ADAM-images" && $scope.query.SelectedDiv == 1) {
  257 + $('html, body').animate({ scrollTop: $rootScope.getLocalStorageValue('AIGridViewScroll') });
244 258 }
245 259 }, 100);
246 260  
... ... @@ -334,24 +348,22 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout
334 348 var currentSearchtext = $rootScope.getLocalStorageValue("SearchText");
335 349 localStorage.setItem("SearchText", '');
336 350 if (currentSearchtext == "undefined" || (currentSearchtext == null || currentSearchtext == "")) {
337   - if (query.SearchText == "undefined" || (query.SearchText == null || query.SearchText == "")) {
  351 + if ($scope.query.SearchText == "undefined" || ($scope.query.SearchText == null || $scope.query.SearchText == "")) {
338 352 $rootScope.errorMessage = AIAConstants.PLEASE_ENTER_SEARCH_TEXT;
339 353 $("#messageModal").modal('show');
340   - // alert("Please enter the text !")
341 354 return false;
342 355 }
343 356 }
344 357  
  358 + while ($scope.searchAIListViewData.length) {
  359 + $scope.searchAIListViewData.pop();
  360 + }
  361 +
345 362 $rootScope.isLoading = true;
346 363 $('#aiSpinner').css('visibility', 'visible');
347 364 $scope.DisableUI();
348 365 $scope.filterstring = true;
349   -
350   - //while ($scope.searchAIListViewData.length) {
351   - // $scope.searchAIListViewData.pop();
352   - //}
353   -
354   - if (typeof (query.SearchText) !== "undefined" && (query.SearchText !== null && query.SearchText !== "")) {
  366 + if (typeof ($scope.query.SearchText) !== "undefined" && ($scope.query.SearchText !== null && $scope.query.SearchText !== "")) {
355 367 localStorage.setItem("SearchText", query.SearchText);
356 368 }
357 369 else {
... ... @@ -369,13 +381,12 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout
369 381 .select();
370 382  
371 383 $('#grid-view').empty();
372   -
373 384 angular.forEach($scope.selectedAIListViewData, function (value, key) {
374 385  
375 386 var selectimg = true;
376 387 //var count = 0;
377   - if (typeof (query.SearchText) !== "undefined" && (query.SearchText !== null && query.SearchText !== "")) {
378   - var SearchText = query.SearchText
  388 + if (typeof ($scope.query.SearchText) !== "undefined" && ($scope.query.SearchText !== null && $scope.query.SearchText !== "")) {
  389 + var SearchText = $scope.query.SearchText
379 390 var posbodyregion = value._Title.toLowerCase().indexOf(SearchText.toLowerCase());
380 391 if (posbodyregion > -1) {
381 392 selectimg = true;
... ... @@ -397,11 +408,6 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout
397 408  
398 409 $compile($el)($scope);
399 410  
400   -
401   - //$(".sidebar").mCustomScrollbar({
402   - // autoHideScrollbar: true,
403   - // //theme:"rounded"
404   - //});
405 411 $scope.searchAIListViewData.push(
406 412 {
407 413 "_id": value._id,
... ... @@ -426,6 +432,7 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout
426 432 $('#aiSpinner').css('visibility', 'hidden');
427 433 setTimeout(function () {
428 434 $scope.EnableUI();
  435 +
429 436 }, 10);
430 437  
431 438 },
... ... @@ -446,7 +453,6 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout
446 453 document.getElementById("imgParent").style.pointerEvents = "auto";
447 454 document.getElementById("imgParent").style.opacity = "1.0";
448 455 }
449   -
450 456 $scope.counter = 1;
451 457 $scope.ApplySearchByAlphabet = function (SearchTextByAlphabet) {
452 458 $rootScope.SearchTextByAlphabet = SearchTextByAlphabet
... ... @@ -462,7 +468,6 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout
462 468 else {
463 469 localStorage.setItem("SearchByAlphabet", '');
464 470 }
465   -
466 471 var promise = DataService.getJson('~/../content/data/json/ai/ai_dat_contentlist.json')
467 472 promise.then(
468 473 function (result) {
... ... @@ -474,6 +479,7 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout
474 479  
475 480 $('#grid-view').empty();
476 481  
  482 +
477 483 angular.forEach($scope.selectedAIListViewData, function (value, key) {
478 484  
479 485 var selectimg = true;
... ... @@ -677,8 +683,6 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout
677 683 $rootScope.isLoading = true;
678 684 $('#aiSpinner').css('visibility', 'visible');
679 685 $('#aiSpinner').css('zIndex', '20000');
680   - //$scope.DisableUI();
681   -
682 686 var promise = DataService.getJson('~/../content/data/json/ai/ai_dat_contentlist.json')
683 687 promise.then(
684 688 function (result) {
... ... @@ -708,9 +712,7 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout
708 712 }
709 713 $rootScope.isLoading = false;
710 714 $('#aiSpinner').css('visibility', 'hidden');
711   - //setTimeout(function () {
712   - // $scope.EnableUI();
713   - //}, 10);
  715 +
714 716 },
715 717 function (error) {
716 718 // handle errors here
... ...
400-SOURCECODE/AIAHTML5.Web/app/views/ai/ai-view.html
... ... @@ -8,47 +8,47 @@
8 8 <form class="form-inline padd5">
9 9 <div class="form-group">
10 10 <label for="exampleInputName2" class="text-primary">Search</label>
11   - <input type="text" ng-change="hideListViewDiv()" ng-model="query.SearchText" class="form-control input-sm col-sm" id="txtSerachInput" placeholder="">
  11 + <input type="text" ng-model="query.SearchText" class="form-control input-sm col-sm" id="txtSerachInput" placeholder="">
12 12 </div>
13 13 <button type="button" class="btn btn-primary btn-sm" ng-click="ApplySearch(query)" style="margin-right:2px;">
14 14 <i class="fa fa-search"></i>
15 15 </button>
16 16 </form>
17   - <nav>
18   - <ul class="pagination pagination-sm no-margin" style="cursor: pointer;">
19   - <li><span id="A" ng-click="ApplySearchByAlphabet('A')"> A</span></li>
20   - <li><span id="B" ng-click="ApplySearchByAlphabet('B')"> B</span></li>
21   - <li><span id="C" ng-click="ApplySearchByAlphabet('C')"> C</span></li>
22   - <li><span id="D" ng-click="ApplySearchByAlphabet('D')"> D</span></li>
23   - <li><span id="E" ng-click="ApplySearchByAlphabet('E')"> E</span></li>
24   - <li><span id="F" ng-click="ApplySearchByAlphabet('F')"> F</span></li>
25   - <li><span id="G" ng-click="ApplySearchByAlphabet('G')"> G</span></li>
26   - <li><span id="H" ng-click="ApplySearchByAlphabet('H')"> H</span></li>
27   - <li><span id="I" ng-click="ApplySearchByAlphabet('I')"> I</span></li>
28   - <li><span id="J" ng-click="ApplySearchByAlphabet('J')"> J</span></li>
29   - <li><span id="K" ng-click="ApplySearchByAlphabet('K')"> K</span></li>
30   - <li><span id="L" ng-click="ApplySearchByAlphabet('L')"> L</span></li>
31   - <li><span id="M" ng-click="ApplySearchByAlphabet('M')"> M</span></li>
32   - <li><span id="N" ng-click="ApplySearchByAlphabet('N')"> N</span></li>
33   - <li><span id="O" ng-click="ApplySearchByAlphabet('O')"> O</span></li>
34   - <li><span id="P" ng-click="ApplySearchByAlphabet('P')"> P</span></li>
35   - <li><span id="Q" ng-click="ApplySearchByAlphabet('Q')"> Q</span></li>
36   - <li><span id="R" ng-click="ApplySearchByAlphabet('R')"> R</span></li>
37   - <li><span id="S" ng-click="ApplySearchByAlphabet('S')"> S</span></li>
38   - <li><span id="T" ng-click="ApplySearchByAlphabet('T')"> T</span></li>
39   - <li><span id="U" ng-click="ApplySearchByAlphabet('U')"> U</span></li>
40   - <li><span id="V" ng-click="ApplySearchByAlphabet('V')"> V</span></li>
41   - <li><span id="W" ng-click="ApplySearchByAlphabet('W')"> W</span></li>
42   - <li><span id="X" ng-click="ApplySearchByAlphabet('X')"> X</span></li>
43   - <li><span id="Y" ng-click="ApplySearchByAlphabet('Y')"> Y</span></li>
44   - <li><span id="Z" ng-click="ApplySearchByAlphabet('Z')"> Z</span></li>
  17 + <nav>
  18 + <ul class="pagination pagination-sm no-margin" style="cursor: pointer;">
  19 + <li><span id="A" ng-click="ApplySearchByAlphabet('A')"> A</span></li>
  20 + <li><span id="B" ng-click="ApplySearchByAlphabet('B')"> B</span></li>
  21 + <li><span id="C" ng-click="ApplySearchByAlphabet('C')"> C</span></li>
  22 + <li><span id="D" ng-click="ApplySearchByAlphabet('D')"> D</span></li>
  23 + <li><span id="E" ng-click="ApplySearchByAlphabet('E')"> E</span></li>
  24 + <li><span id="F" ng-click="ApplySearchByAlphabet('F')"> F</span></li>
  25 + <li><span id="G" ng-click="ApplySearchByAlphabet('G')"> G</span></li>
  26 + <li><span id="H" ng-click="ApplySearchByAlphabet('H')"> H</span></li>
  27 + <li><span id="I" ng-click="ApplySearchByAlphabet('I')"> I</span></li>
  28 + <li><span id="J" ng-click="ApplySearchByAlphabet('J')"> J</span></li>
  29 + <li><span id="K" ng-click="ApplySearchByAlphabet('K')"> K</span></li>
  30 + <li><span id="L" ng-click="ApplySearchByAlphabet('L')"> L</span></li>
  31 + <li><span id="M" ng-click="ApplySearchByAlphabet('M')"> M</span></li>
  32 + <li><span id="N" ng-click="ApplySearchByAlphabet('N')"> N</span></li>
  33 + <li><span id="O" ng-click="ApplySearchByAlphabet('O')"> O</span></li>
  34 + <li><span id="P" ng-click="ApplySearchByAlphabet('P')"> P</span></li>
  35 + <li><span id="Q" ng-click="ApplySearchByAlphabet('Q')"> Q</span></li>
  36 + <li><span id="R" ng-click="ApplySearchByAlphabet('R')"> R</span></li>
  37 + <li><span id="S" ng-click="ApplySearchByAlphabet('S')"> S</span></li>
  38 + <li><span id="T" ng-click="ApplySearchByAlphabet('T')"> T</span></li>
  39 + <li><span id="U" ng-click="ApplySearchByAlphabet('U')"> U</span></li>
  40 + <li><span id="V" ng-click="ApplySearchByAlphabet('V')"> V</span></li>
  41 + <li><span id="W" ng-click="ApplySearchByAlphabet('W')"> W</span></li>
  42 + <li><span id="X" ng-click="ApplySearchByAlphabet('X')"> X</span></li>
  43 + <li><span id="Y" ng-click="ApplySearchByAlphabet('Y')"> Y</span></li>
  44 + <li><span id="Z" ng-click="ApplySearchByAlphabet('Z')"> Z</span></li>
  45 +
  46 + </ul>
  47 + <button type="button" class="btn btn-primary btn-sm" ng-click="Reset(query)" style="margin-bottom:23px"><i class="fa fa-eye"></i>Show All</button>
  48 + </nav>
45 49  
46   - </ul>
47   - <button type="button" class="btn btn-primary btn-sm" ng-click="Reset(query)" style="margin-bottom:23px"><i class="fa fa-eye"></i>Show All</button>
48   - </nav>
49   -
50 50 </div>
51   -
  51 +
52 52 </div>
53 53 </div>
54 54 </div>
... ... @@ -97,7 +97,7 @@
97 97 </div>
98 98 </div>
99 99 </div>
100   - <div id="aiSpinner" class="spinner" ng-show="isLoading" style="visibility: hidden; opacity: 1; width: 100%; height: 100%; top: 0; bottom: 0%; left: 0; right: 0%; margin-left: 0px;">
  100 + <div id="aiSpinner" class="spinner" ng-show="isLoading" style="visibility: hidden; opacity: 1; width: 100%; height: 100%; top: 0; bottom: 0%; left: 0; right: 0%; margin-left: 0px;">
101 101 <img id="img-spinner" class="spinner" src="content/images/common/loading.gif" alt="Loading" />
102 102 </div>
103 103 </div>
... ...