Commit 748db360929a6f4e4bec8e918662ef6f9fc963b8

Authored by Nikita Kulshreshtha
1 parent 559ab2d9

spinner lasts till the process finish.

removed commented code.
400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js
@@ -735,6 +735,9 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo @@ -735,6 +735,9 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
735 //calculate coordinates for body region images 735 //calculate coordinates for body region images
736 $scope.CalculateImageCordinates = function (viewOrientationId) { 736 $scope.CalculateImageCordinates = function (viewOrientationId) {
737 737
  738 + $rootScope.isLoading = true;
  739 + $('#spinner').css('visibility', 'visible');
  740 +
738 // annotation toolbar canvas 741 // annotation toolbar canvas
739 if ($("#canvasDiv").find("canvas[id='canvasPaint']").length == 0) { 742 if ($("#canvasDiv").find("canvas[id='canvasPaint']").length == 0) {
740 743
@@ -744,6 +747,8 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo @@ -744,6 +747,8 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
744 747
745 } 748 }
746 749
  750 +
  751 +
747 $scope.terminateCurrentlyRunningWPs(); 752 $scope.terminateCurrentlyRunningWPs();
748 753
749 var drawnBodyRegionCount = []; 754 var drawnBodyRegionCount = [];
@@ -948,8 +953,8 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo @@ -948,8 +953,8 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
948 953
949 }); 954 });
950 955
951 - $rootScope.isLoading = false;  
952 - $('#spinner').css('visibility', 'hidden'); 956 + //$rootScope.isLoading = false;
  957 + //$('#spinner').css('visibility', 'hidden');
953 } 958 }
954 959
955 if (($rootScope.globalSetting.modesty == 'Y')) { 960 if (($rootScope.globalSetting.modesty == 'Y')) {
@@ -1205,6 +1210,9 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo @@ -1205,6 +1210,9 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
1205 1210
1206 $scope.DrawMirroredImage = function (h, w, x, y, src, bodyRegionId, isMaskImage) { 1211 $scope.DrawMirroredImage = function (h, w, x, y, src, bodyRegionId, isMaskImage) {
1207 1212
  1213 + $rootScope.isLoading = true;
  1214 + $('#spinner').css('visibility', 'visible');
  1215 +
1208 var FlipedImgCanvas = document.createElement('canvas'); 1216 var FlipedImgCanvas = document.createElement('canvas');
1209 FlipedImgCanvas.height = h; 1217 FlipedImgCanvas.height = h;
1210 FlipedImgCanvas.width = w; 1218 FlipedImgCanvas.width = w;
@@ -1532,6 +1540,10 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo @@ -1532,6 +1540,10 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
1532 //}, 500); 1540 //}, 500);
1533 } 1541 }
1534 } 1542 }
  1543 + else {
  1544 + $rootScope.isLoading = false;
  1545 + $('#spinner').css('visibility', 'hidden');
  1546 + }
1535 } 1547 }
1536 1548
1537 // console.log('ColoredImageSRC. pushed and length: ' + $scope.ColoredImageSRC.length); 1549 // console.log('ColoredImageSRC. pushed and length: ' + $scope.ColoredImageSRC.length);
@@ -1564,6 +1576,9 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo @@ -1564,6 +1576,9 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
1564 1576
1565 $scope.DrawImage = function (h, w, x, y, src, bodyRegionId, isMaskImage) { 1577 $scope.DrawImage = function (h, w, x, y, src, bodyRegionId, isMaskImage) {
1566 1578
  1579 + $rootScope.isLoading = true;
  1580 + $('#spinner').css('visibility', 'visible');
  1581 +
1567 var imgCanvas = document.createElement('canvas'); 1582 var imgCanvas = document.createElement('canvas');
1568 1583
1569 imgCanvas.height = h; 1584 imgCanvas.height = h;
@@ -1895,6 +1910,10 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo @@ -1895,6 +1910,10 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
1895 1910
1896 } 1911 }
1897 } 1912 }
  1913 + else {
  1914 + $rootScope.isLoading = false;
  1915 + $('#spinner').css('visibility', 'hidden');
  1916 + }
1898 } 1917 }
1899 1918
1900 console.log('ColoredImageSRC. pushed and length: ' + $scope.ColoredImageSRC.length); 1919 console.log('ColoredImageSRC. pushed and length: ' + $scope.ColoredImageSRC.length);
@@ -2165,7 +2184,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo @@ -2165,7 +2184,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
2165 $scope.aligneCanvasWithTerm() 2184 $scope.aligneCanvasWithTerm()
2166 } 2185 }
2167 2186
2168 - $timeout(function () { $scope.DisableProgressBar() }, 1000); 2187 + // $timeout(function () { $scope.DisableProgressBar() }, 1000);
2169 2188
2170 2189
2171 2190
@@ -2399,16 +2418,19 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo @@ -2399,16 +2418,19 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
2399 2418
2400 if ($scope.doAligneCanvasWithTerm == true) { 2419 if ($scope.doAligneCanvasWithTerm == true) {
2401 2420
2402 - if ($rootScope.isHighlightBodyByBodySystem == true || $rootScope.isListManagerSelected == true) 2421 + if ($rootScope.isListManagerSelected == true)
  2422 + $scope.aligneCanvasWithTerm();
  2423 +
  2424 + else if ($rootScope.isHighlightBodyByBodySystem == true || $rootScope.isListManagerSelected == true) {
2403 2425
2404 $rootScope.isLoading = false; 2426 $rootScope.isLoading = false;
2405 2427
2406 - $('#spinner').css('visibility', 'hidden'); 2428 + $('#spinner').css('visibility', 'hidden');
  2429 + }
2407 2430
2408 // $rootScope.isHighlightBodyByBodySystem = false; 2431 // $rootScope.isHighlightBodyByBodySystem = false;
2409 2432
2410 - if ($rootScope.isListManagerSelected == true)  
2411 - $scope.aligneCanvasWithTerm(); 2433 +
2412 } 2434 }
2413 } 2435 }
2414 // 2436 //
@@ -5018,56 +5040,10 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo @@ -5018,56 +5040,10 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
5018 5040
5019 $scope.flushCanvas = function () { 5041 $scope.flushCanvas = function () {
5020 5042
5021 - //if ($scope.ColoredImageSRC != null || $scope.ColoredImageSRC != undefined) {  
5022 - // angular.forEach($scope.ColoredImageSRC, function (value, key) {  
5023 -  
5024 - // var id;  
5025 - // var maskId;  
5026 - // if (value.haveMirror == 'true') {  
5027 - // id = 'imageCanvas' + value.bodyRegionId + '_MR';  
5028 - // maskId = 'imageCanvas' + value.bodyRegionId + '_MR_mci'  
5029 - // }  
5030 - // else {  
5031 - // id = 'imageCanvas' + value.bodyRegionId;  
5032 - // maskId = 'imageCanvas' + value.bodyRegionId + '_mci';  
5033 - // }  
5034 5043
5035 - // var canvas = document.getElementById(id);  
5036 - // if (canvas != null || canvas != undefined) {  
5037 - // document.getElementById('canvasDiv').removeChild(canvas);  
5038 - // }  
5039 -  
5040 - // var maskcanvas = document.getElementById(maskId);  
5041 - // if (maskcanvas != null || maskcanvas != undefined) {  
5042 - // document.getElementById('canvasDiv').removeChild(maskcanvas); 5044 + $rootScope.isLoading = true;
  5045 + $('#spinner').css('visibility', 'visible');
5043 5046
5044 - // }  
5045 - // if (i == 4 || i == 5 || i == 6) {  
5046 - // id = 'imageCanvas' + i + '_MR';  
5047 - // maskId = 'imageCanvas' + i + '_MR_mci';  
5048 -  
5049 - // var canvas = document.getElementById(id);  
5050 - // if (canvas != null || canvas != undefined)  
5051 - // document.getElementById('canvasDiv').removeChild(canvas);  
5052 -  
5053 - // var maskcanvas = document.getElementById(maskId);  
5054 - // if (maskcanvas != null || maskcanvas != undefined)  
5055 - // document.getElementById('canvasDiv').removeChild(maskcanvas);  
5056 - // }  
5057 -  
5058 - // var modestyCanvases = $("canvas[id*='imageCanvasmodestyImg']");  
5059 - // for (var i = 0; i < modestyCanvases.length; i++) {  
5060 - // modestyCanvases[i].remove();  
5061 - // }  
5062 - // });  
5063 - // //remove modesty canavs  
5064 - // var modestyCanvases = $("canvas[id*='imageCanvasmodestyImg']");  
5065 - // if (modestyCanvases != null || modestyCanvases != undefined && modestyCanvases.length > 0) {  
5066 - // for (var j = 0; j < modestyCanvases.length; j++) {  
5067 - // modestyCanvases[j].remove();  
5068 - // }  
5069 - // }  
5070 - //}  
5071 var endIndex = 0; 5047 var endIndex = 0;
5072 var startIndex = 0; 5048 var startIndex = 0;
5073 if (($rootScope.viewOrientationId == '1') || ($rootScope.viewOrientationId == '4')) { 5049 if (($rootScope.viewOrientationId == '1') || ($rootScope.viewOrientationId == '4')) {
@@ -5625,9 +5601,9 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo @@ -5625,9 +5601,9 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
5625 if ($scope.isEligibleForHighlightBodyByTermList == true) { 5601 if ($scope.isEligibleForHighlightBodyByTermList == true) {
5626 //DISABLE PROGERSS BAR FOR GENDER OR VIEW CHANGE 5602 //DISABLE PROGERSS BAR FOR GENDER OR VIEW CHANGE
5627 // if ($rootScope.isGenderChnage == true || $rootScope.isViewChange == true) { 5603 // if ($rootScope.isGenderChnage == true || $rootScope.isViewChange == true) {
5628 - $scope.isLoading = false; 5604 + //$scope.isLoading = false;
5629 5605
5630 - $('#spinner').css('visibility', 'hidden'); 5606 + //$('#spinner').css('visibility', 'hidden');
5631 //} 5607 //}
5632 5608
5633 if (($rootScope.isHighlightBodyByBodySystem == true) && ($scope.systemMatchedTermList != null || $scope.systemMatchedTermList != undefined)) { 5609 if (($rootScope.isHighlightBodyByBodySystem == true) && ($scope.systemMatchedTermList != null || $scope.systemMatchedTermList != undefined)) {
@@ -7003,6 +6979,12 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo @@ -7003,6 +6979,12 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
7003 $('#spinner').css('visibility', 'hidden'); 6979 $('#spinner').css('visibility', 'hidden');
7004 } 6980 }
7005 else { 6981 else {
  6982 +
  6983 + $rootScope.isLoading = true;
  6984 +
  6985 + $('#spinner').css('visibility', 'visible');
  6986 +
  6987 +
7006 $rootScope.prevId = event.currentTarget.id; 6988 $rootScope.prevId = event.currentTarget.id;
7007 $("#termList").find("option").attr('selected', false); 6989 $("#termList").find("option").attr('selected', false);
7008 $("#termList").find("option").css({ "background-color": "#ffffff", "color": "#000000" }); 6990 $("#termList").find("option").css({ "background-color": "#ffffff", "color": "#000000" });
@@ -7025,10 +7007,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo @@ -7025,10 +7007,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
7025 } 7007 }
7026 } 7008 }
7027 //--- 7009 //---
7028 - $rootScope.isLoading = true;  
7029 -  
7030 - $('#spinner').css('visibility', 'visible');  
7031 - 7010 +
7032 $rootScope.isHighlightBodyByBodySystem = false; 7011 $rootScope.isHighlightBodyByBodySystem = false;
7033 7012
7034 //1. 7013 //1.
@@ -7134,8 +7113,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo @@ -7134,8 +7113,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
7134 7113
7135 //8.remove current layer canavses 7114 //8.remove current layer canavses
7136 $scope.flushCanvas(); 7115 $scope.flushCanvas();
7137 -  
7138 - 7116 +
7139 7117
7140 //9. 7118 //9.
7141 $timeout(function () { 7119 $timeout(function () {
@@ -7150,6 +7128,9 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo @@ -7150,6 +7128,9 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
7150 //DA > Annotation's Line should not displayed. 7128 //DA > Annotation's Line should not displayed.
7151 $("#bord").css("display", "none"); 7129 $("#bord").css("display", "none");
7152 7130
  7131 + $rootScope.isLoading = true;
  7132 + $('#spinner').css('visibility', 'visible');
  7133 +
7153 //redraw body of respective layer 7134 //redraw body of respective layer
7154 $scope.CalculateImageCordinates($rootScope.viewOrientationId) 7135 $scope.CalculateImageCordinates($rootScope.viewOrientationId)
7155 }, 500); 7136 }, 500);