Commit f5705ac0d128efe31aa29774c8877d837175fbad

Authored by Utkarsh Singh
1 parent 499636be

Committed code refs: #12113

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