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