Commit f5705ac0d128efe31aa29774c8877d837175fbad

Authored by Utkarsh Singh
1 parent 499636be

Committed code refs: #12113

400-SOURCECODE/AIAHTML5.Web/app/controllers/CIController.js
1 1 AIA.controller("CIController", ["$scope", "$window", "$rootScope", "$compile", "$http", "$log", "$location", "$timeout", "pages", "BodyRegions", "BodySystems", "ViewOrientations", "ImageTypes", "MedicalSpecialties", "DataService",
2 2 function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout, pages, BodyRegions, BodySystems, ViewOrientations, ImageTypes, MedicalSpecialties, DataService) {
3   - // $rootScope.currentActiveModuleTitle = pages[3].name;
  3 + // $rootScope.currentActiveModuleTitle = pages[3].name;
4 4 $scope.showme = true;
5 5 $scope.IllustrationData;
6 6 $scope.CIAllBodyRegion = [];
... ... @@ -76,9 +76,11 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout
76 76 else {
77 77 $scope.setActiveTab(1);
78 78 $scope.reRunSearchOnLoad();
  79 + if (localStorage.getItem('CIGridViewScroll') !== null) {
  80 + $('html, body').animate({ scrollTop: localStorage.getItem('CIGridViewScroll') });
  81 + }
79 82 }
80 83  
81   -
82 84  
83 85 });
84 86  
... ... @@ -167,7 +169,7 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout
167 169 .orderBy([{ field: '_Title', sort: 'asc' }])
168 170 .select();
169 171  
170   - // console.log($scope.selectedCIListViewData);
  172 + // console.log($scope.selectedCIListViewData);
171 173 $('#grid-view').empty();
172 174 angular.forEach($scope.selectedCIListViewData, function (value, key) {
173 175 $scope.imagePath = "~/../content/images/ci/thumbnails/" + value._ThumbnailImage;
... ... @@ -294,7 +296,7 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout
294 296 localStorage.setItem("CICurBodyRegion", '');
295 297 }
296 298  
297   - if (typeof (query.selectedbodysystem) !== "undefined" && (query.selectedbodysystem !== null && query.selectedbodysystem !=="")) {
  299 + if (typeof (query.selectedbodysystem) !== "undefined" && (query.selectedbodysystem !== null && query.selectedbodysystem !== "")) {
298 300 filtercount = filtercount + 1;
299 301 localStorage.setItem("CICurBodySystem", query.selectedbodysystem);
300 302 }
... ... @@ -461,7 +463,7 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout
461 463 }
462 464 );
463 465  
464   -
  466 +
465 467 }
466 468  
467 469  
... ... @@ -469,7 +471,7 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout
469 471 $("html,body").scrollTop(0);
470 472 }
471 473  
472   -
  474 +
473 475 $scope.openView = function ($event) {
474 476  
475 477 $rootScope.MenuModuleName = "CI";
... ... @@ -483,8 +485,8 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout
483 485 .where('_id = ' + $event.currentTarget.id)
484 486 .select('_Title');
485 487  
486   - // console.log(CITitle);
487   - // console.log($scope.selectedCIListViewData);
  488 + // console.log(CITitle);
  489 + // console.log($scope.selectedCIListViewData);
488 490  
489 491 $rootScope.ViewTitle = CITitle[0]._Title;
490 492 }
... ... @@ -492,20 +494,23 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout
492 494 $rootScope.ViewTitle = $event.currentTarget.textContent;
493 495  
494 496 }
495   -
  497 +
496 498  
497 499 localStorage.setItem("currentViewTitleFromJson", $rootScope.ViewTitle);
498 500 localStorage.setItem("currentBodyViewId", $event.currentTarget.id);
499 501  
  502 + //Set the vertical scroll value of the Grid-View.
  503 + var y = $($window).scrollTop();
  504 + localStorage.setItem("CIGridViewScroll", y);
500 505 var u = $location.url();
501 506 $location.url('/clinical-illustrations-detail');
502 507  
503   - // console.log($location.url('/clinical-illustrations-detail'));
  508 + // console.log($location.url('/clinical-illustrations-detail'));
504 509  
505 510 }
506 511  
507 512 $scope.openBodyView = function () {
508   -
  513 +
509 514 $rootScope.isLoading = true;
510 515 $('#spinner').css('visibility', 'visible');
511 516 $scope.voId = localStorage.getItem("currentBodyViewId");
... ... @@ -514,7 +519,7 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout
514 519  
515 520  
516 521 //once you get id in scope push detail in jspanel content
517   -
  522 +
518 523 var openViews;
519 524 if ($rootScope.openViews.length > 0) {
520 525 openViews = new jinqJs()
... ... @@ -615,13 +620,13 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout
615 620  
616 621 );
617 622  
618   - // console.log($rootScope.openViews);
  623 + // console.log($rootScope.openViews);
619 624 $('#CIView').css("height", $(window).outerHeight());
620 625  
621 626 $('#CIView').css("width", $(window).outerWidth());
622 627  
623 628 }
624   -
  629 +
625 630 $scope.$on('annotationToolEvent', function (event, data) {
626 631  
627 632 $('#editstylebackgroundcolor .minicolors >.minicolors-swatch > .minicolors-swatch-color').css("background-color", "rgb(255,255,255)")
... ... @@ -631,7 +636,7 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout
631 636  
632 637 $("#canvas").css("display", "block");
633 638 $("#canvasPaint").css("display", "block");
634   -
  639 +
635 640 $rootScope.onDrawingCanvasClick();
636 641 $rootScope.FreeStylePaint();
637 642 });
... ...