Commit 18fab3c4352972d2e9fc45112811dca1ef534b7c

Authored by Nikita Kulshreshtha
1 parent bab9b7bb

after reverting flushCanavs to coloredImage src dependent, List manager stopped working.

Reverted that code and apllied loop length as per view.
Now LM is working.
400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js
... ... @@ -2262,7 +2262,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
2262 2262  
2263 2263 $('#spinner').css('visibility', 'hidden');
2264 2264  
2265   - //$rootScope.isHighlightBodyByBodySystem = false;
  2265 + $rootScope.isHighlightBodyByBodySystem = false;
2266 2266  
2267 2267 if ($rootScope.isListManagerSelected == true)
2268 2268 $scope.aligneCanvasWithTerm();
... ... @@ -4750,30 +4750,88 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
4750 4750  
4751 4751 $scope.flushCanvas = function () {
4752 4752  
4753   - if ($scope.ColoredImageSRC != null || $scope.ColoredImageSRC != undefined) {
4754   - angular.forEach($scope.ColoredImageSRC, function (value, key) {
  4753 + //if ($scope.ColoredImageSRC != null || $scope.ColoredImageSRC != undefined) {
  4754 + // angular.forEach($scope.ColoredImageSRC, function (value, key) {
4755 4755  
4756   - var id;
4757   - var maskId;
4758   - if (value.haveMirror == 'true') {
4759   - id = 'imageCanvas' + value.bodyRegionId + '_MR';
4760   - maskId = 'imageCanvas' + value.bodyRegionId + '_MR_mci'
4761   - }
4762   - else {
4763   - id = 'imageCanvas' + value.bodyRegionId;
4764   - maskId = 'imageCanvas' + value.bodyRegionId + '_mci';
4765   - }
  4756 + // var id;
  4757 + // var maskId;
  4758 + // if (value.haveMirror == 'true') {
  4759 + // id = 'imageCanvas' + value.bodyRegionId + '_MR';
  4760 + // maskId = 'imageCanvas' + value.bodyRegionId + '_MR_mci'
  4761 + // }
  4762 + // else {
  4763 + // id = 'imageCanvas' + value.bodyRegionId;
  4764 + // maskId = 'imageCanvas' + value.bodyRegionId + '_mci';
  4765 + // }
4766 4766  
4767   - var canvas = document.getElementById(id);
4768   - if (canvas != null || canvas != undefined) {
4769   - document.getElementById('canvasDiv').removeChild(canvas);
4770   - }
  4767 + // var canvas = document.getElementById(id);
  4768 + // if (canvas != null || canvas != undefined) {
  4769 + // document.getElementById('canvasDiv').removeChild(canvas);
  4770 + // }
4771 4771  
4772   - var maskcanvas = document.getElementById(maskId);
4773   - if (maskcanvas != null || maskcanvas != undefined) {
4774   - document.getElementById('canvasDiv').removeChild(maskcanvas);
  4772 + // var maskcanvas = document.getElementById(maskId);
  4773 + // if (maskcanvas != null || maskcanvas != undefined) {
  4774 + // document.getElementById('canvasDiv').removeChild(maskcanvas);
  4775 +
  4776 + // }
  4777 + // if (i == 4 || i == 5 || i == 6) {
  4778 + // id = 'imageCanvas' + i + '_MR';
  4779 + // maskId = 'imageCanvas' + i + '_MR_mci';
  4780 +
  4781 + // var canvas = document.getElementById(id);
  4782 + // if (canvas != null || canvas != undefined)
  4783 + // document.getElementById('canvasDiv').removeChild(canvas);
  4784 +
  4785 + // var maskcanvas = document.getElementById(maskId);
  4786 + // if (maskcanvas != null || maskcanvas != undefined)
  4787 + // document.getElementById('canvasDiv').removeChild(maskcanvas);
  4788 + // }
  4789 +
  4790 + // var modestyCanvases = $("canvas[id*='imageCanvasmodestyImg']");
  4791 + // for (var i = 0; i < modestyCanvases.length; i++) {
  4792 + // modestyCanvases[i].remove();
  4793 + // }
  4794 + // });
  4795 + // //remove modesty canavs
  4796 + // var modestyCanvases = $("canvas[id*='imageCanvasmodestyImg']");
  4797 + // if (modestyCanvases != null || modestyCanvases != undefined && modestyCanvases.length > 0) {
  4798 + // for (var j = 0; j < modestyCanvases.length; j++) {
  4799 + // modestyCanvases[j].remove();
  4800 + // }
  4801 + // }
  4802 + //}
  4803 + var loopLength = 0;
  4804 + if (($rootScope.viewOrientationId == '1') || ($rootScope.viewOrientationId == '4')) {
  4805 + loopLength = 7;
  4806 + }
  4807 + else if (($rootScope.viewOrientationId == '2') || ($rootScope.viewOrientationId == '3')){
  4808 + loopLength = 5;
  4809 + }
  4810 + else if (($rootScope.viewOrientationId == '5')) {
  4811 + loopLength = 4;
  4812 + }
  4813 + else if (($rootScope.viewOrientationId == '6')) {
  4814 + loopLength = 1;
  4815 + }
  4816 +
  4817 + for (var i = 1; i < loopLength; i++) {
  4818 +
  4819 + var id;
  4820 + var maskId;
  4821 +
  4822 + id = 'imageCanvas' + i;
  4823 + maskId = 'imageCanvas' + i + '_mci';
  4824 +
  4825 + var canvas = document.getElementById(id);
  4826 + if (canvas != null || canvas != undefined)
  4827 + document.getElementById('canvasDiv').removeChild(canvas);
  4828 +
  4829 + var maskcanvas = document.getElementById(maskId);
  4830 + if (maskcanvas != null || maskcanvas != undefined)
  4831 + document.getElementById('canvasDiv').removeChild(maskcanvas);
  4832 +
  4833 + if (loopLength == 7) {
4775 4834  
4776   - }
4777 4835 if (i == 4 || i == 5 || i == 6) {
4778 4836 id = 'imageCanvas' + i + '_MR';
4779 4837 maskId = 'imageCanvas' + i + '_MR_mci';
... ... @@ -4786,12 +4844,8 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
4786 4844 if (maskcanvas != null || maskcanvas != undefined)
4787 4845 document.getElementById('canvasDiv').removeChild(maskcanvas);
4788 4846 }
  4847 + }
4789 4848  
4790   - var modestyCanvases = $("canvas[id*='imageCanvasmodestyImg']");
4791   - for (var i = 0; i < modestyCanvases.length; i++) {
4792   - modestyCanvases[i].remove();
4793   - }
4794   - });
4795 4849 //remove modesty canavs
4796 4850 var modestyCanvases = $("canvas[id*='imageCanvasmodestyImg']");
4797 4851 if (modestyCanvases != null || modestyCanvases != undefined && modestyCanvases.length > 0) {
... ...