Commit 4e7c6d8ad050c98d9b6d11f81883364435edc58e

Authored by mangaldeep patel
1 parent d0789d51

AIA BUG

400-SOURCECODE/AIAHTML5.Web/app/controllers/AIController.js
@@ -20,6 +20,20 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout @@ -20,6 +20,20 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout
20 $scope.setActiveTab = function (tabToSet) { 20 $scope.setActiveTab = function (tabToSet) {
21 $scope.activeTab = tabToSet; 21 $scope.activeTab = tabToSet;
22 localStorage.setItem("currentAITabView", $scope.activeTab); 22 localStorage.setItem("currentAITabView", $scope.activeTab);
  23 + if (tabToSet == 2) {
  24 + var curSelectedRowId = $rootScope.getLocalStorageValue("AISelectedRowId");
  25 + $('#' + $rootScope.getLocalStorageValue("currentAIImageId")).addClass("selected");
  26 + $scope.idSelected = $rootScope.getLocalStorageValue("currentAIImageId");
  27 + var selectedImageId = $rootScope.getLocalStorageValue("currentAIImageId");
  28 + $scope.LoadAIJsonData();
  29 + $scope.ReloadListViewImageDiv(selectedImageId);
  30 + $scope.showItem(selectedImageId);
  31 + }
  32 + else {
  33 + $('#' + $rootScope.getLocalStorageValue("currentAIImageId")).find('.thumbnail').addClass('HightLightThumbnail');
  34 + $('#' + $rootScope.getLocalStorageValue("currentAIImageId")).removeClass('selected');
  35 + $scope.loadAllAI();
  36 + }
23 }; 37 };
24 38
25 $scope.$on('$viewContentLoaded', function (event) { 39 $scope.$on('$viewContentLoaded', function (event) {
@@ -49,7 +63,7 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout @@ -49,7 +63,7 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout
49 //set the local storage 63 //set the local storage
50 64
51 var curtab = $rootScope.getLocalStorageValue("currentAITabView"); 65 var curtab = $rootScope.getLocalStorageValue("currentAITabView");
52 - if (curtab == 2) { 66 + if (curtab == 2) {
53 $scope.setActiveTab(2); 67 $scope.setActiveTab(2);
54 var curSelectedRowId = $rootScope.getLocalStorageValue("AISelectedRowId"); 68 var curSelectedRowId = $rootScope.getLocalStorageValue("AISelectedRowId");
55 if (typeof (curSelectedRowId) !== "undefined" && curSelectedRowId !== null && curSelectedRowId !== '') { 69 if (typeof (curSelectedRowId) !== "undefined" && curSelectedRowId !== null && curSelectedRowId !== '') {
@@ -214,9 +228,6 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout @@ -214,9 +228,6 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout
214 $scope.Reset = function (query) { 228 $scope.Reset = function (query) {
215 $('ul li a').removeAttr("style"); 229 $('ul li a').removeAttr("style");
216 query.SearchText = ""; 230 query.SearchText = "";
217 -  
218 -  
219 -  
220 //set localstorage values 231 //set localstorage values
221 localStorage.setItem("SearchText", ''); 232 localStorage.setItem("SearchText", '');
222 localStorage.setItem("SearchByAlphabet", ''); 233 localStorage.setItem("SearchByAlphabet", '');
@@ -252,25 +263,17 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout @@ -252,25 +263,17 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout
252 263
253 $rootScope.isLoading = true; 264 $rootScope.isLoading = true;
254 $('#spinner').css('visibility', 'visible'); 265 $('#spinner').css('visibility', 'visible');
255 -  
256 -  
257 $scope.filterstring = true; 266 $scope.filterstring = true;
258 267
259 while ($scope.searchAIListViewData.length) { 268 while ($scope.searchAIListViewData.length) {
260 $scope.searchAIListViewData.pop(); 269 $scope.searchAIListViewData.pop();
261 } 270 }
262 271
263 -  
264 -  
265 -  
266 if (typeof (query.SearchText) !== "undefined" && (query.SearchText !== null && query.SearchText !== "")) { 272 if (typeof (query.SearchText) !== "undefined" && (query.SearchText !== null && query.SearchText !== "")) {
267 -  
268 localStorage.setItem("SearchText", query.SearchText); 273 localStorage.setItem("SearchText", query.SearchText);
269 -  
270 } 274 }
271 else { 275 else {
272 localStorage.setItem("SearchText", ''); 276 localStorage.setItem("SearchText", '');
273 -  
274 } 277 }
275 278
276 var promise = DataService.getJson('~/../content/data/json/ai/ai_dat_contentlist.json') 279 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 @@ -295,13 +298,11 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout
295 if (posbodyregion > -1) { 298 if (posbodyregion > -1) {
296 selectimg = true; 299 selectimg = true;
297 //count = count + 1; 300 //count = count + 1;
298 -  
299 } 301 }
300 else { 302 else {
301 selectimg = false; 303 selectimg = false;
302 //count = count - 1; 304 //count = count - 1;
303 } 305 }
304 -  
305 } 306 }
306 307
307 if (selectimg === true) { 308 if (selectimg === true) {
@@ -319,8 +320,6 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout @@ -319,8 +320,6 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout
319 autoHideScrollbar: true, 320 autoHideScrollbar: true,
320 //theme:"rounded" 321 //theme:"rounded"
321 }); 322 });
322 -  
323 -  
324 $scope.searchAIListViewData.push( 323 $scope.searchAIListViewData.push(
325 { 324 {
326 "_id": value._id, 325 "_id": value._id,
@@ -328,8 +327,6 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout @@ -328,8 +327,6 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout
328 "_Title": value._Title, 327 "_Title": value._Title,
329 "_contentImage": value._contentImage, 328 "_contentImage": value._contentImage,
330 "_ThumbnailImage": value._ThumbnailImage, 329 "_ThumbnailImage": value._ThumbnailImage,
331 -  
332 -  
333 }); 330 });
334 } 331 }
335 }); 332 });
@@ -414,13 +411,10 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout @@ -414,13 +411,10 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout
414 411
415 $compile($el)($scope); 412 $compile($el)($scope);
416 413
417 -  
418 $(".sidebar").mCustomScrollbar({ 414 $(".sidebar").mCustomScrollbar({
419 autoHideScrollbar: true, 415 autoHideScrollbar: true,
420 //theme:"rounded" 416 //theme:"rounded"
421 }); 417 });
422 -  
423 -  
424 $scope.searchAIListViewData.push( 418 $scope.searchAIListViewData.push(
425 { 419 {
426 "_id": value._id, 420 "_id": value._id,
@@ -428,8 +422,6 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout @@ -428,8 +422,6 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout
428 "_Title": value._Title, 422 "_Title": value._Title,
429 "_contentImage": value._contentImage, 423 "_contentImage": value._contentImage,
430 "_ThumbnailImage": value._ThumbnailImage, 424 "_ThumbnailImage": value._ThumbnailImage,
431 -  
432 -  
433 }); 425 });
434 } 426 }
435 }); 427 });
@@ -594,6 +586,9 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout @@ -594,6 +586,9 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout
594 //console.log(id); 586 //console.log(id);
595 $scope.idSelected = id; 587 $scope.idSelected = id;
596 $scope.hiderow = true; 588 $scope.hiderow = true;
  589 + $rootScope.isLoading = true;
  590 + $('#aiSpinner').css('visibility', 'visible');
  591 + $('#aiSpinner').css('zIndex', '20000');
597 592
598 var promise = DataService.getJson('~/../content/data/json/ai/ai_dat_contentlist.json') 593 var promise = DataService.getJson('~/../content/data/json/ai/ai_dat_contentlist.json')
599 promise.then( 594 promise.then(
@@ -618,11 +613,12 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout @@ -618,11 +613,12 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout
618 $('#ListViewDiv').animate({ scrollTop: $rootScope.getLocalStorageValue("AIListViewScroll") }); 613 $('#ListViewDiv').animate({ scrollTop: $rootScope.getLocalStorageValue("AIListViewScroll") });
619 } 614 }
620 else { 615 else {
621 - $('#ListViewDiv').scrollTop($rootScope.getLocalStorageValue("AIListViewScroll")); 616 + $('#ListViewDiv').scrollTop($rootScope.getLocalStorageValue("AIListViewScroll"));
622 } 617 }
623 618
624 } 619 }
625 - 620 + $rootScope.isLoading = false;
  621 + $('#aiSpinner').css('visibility', 'hidden');
626 }, 622 },
627 function (error) { 623 function (error) {
628 // handle errors here 624 // handle errors here
@@ -638,9 +634,6 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout @@ -638,9 +634,6 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout
638 $scope.hiderow = false; 634 $scope.hiderow = false;
639 } 635 }
640 } 636 }
641 -  
642 -  
643 -  
644 }] 637 }]
645 ); 638 );
646 639