diff --git a/400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js b/400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js index ec91638..7b50a73 100644 --- a/400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js +++ b/400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js @@ -1470,14 +1470,16 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo var imageCanvas = document.getElementById('imageCanvas' + bodyRegionId + '_MR'); - var width = imageCanvas.width; - var ht = imageCanvas.height; + if (imageCanvas != null || imageCanvas != undefined) { + var width = imageCanvas.width; + var ht = imageCanvas.height; + + var coloredCanvasContext = imageCanvas.getContext("2d"); + var coloredImageData = coloredCanvasContext.getImageData(0, 0, width, ht); + var coloredImageDataVar = coloredImageData; - var coloredCanvasContext = imageCanvas.getContext("2d"); - var coloredImageData = coloredCanvasContext.getImageData(0, 0, width, ht); - var coloredImageDataVar = coloredImageData; - $rootScope.coloredImageMRCanvasList[parseInt(bodyRegionId)] = coloredImageDataVar; + } @@ -1831,15 +1833,17 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo var imageCanvas = document.getElementById('imageCanvas' + bodyRegionId); - var width = imageCanvas.width; - var ht = imageCanvas.height; + if (imageCanvas != null || imageCanvas != undefined) { + var width = imageCanvas.width; + var ht = imageCanvas.height; + + var coloredCanvasContext = imageCanvas.getContext("2d"); + var coloredImageData = coloredCanvasContext.getImageData(0, 0, width, ht); + var coloredImageDataVar = coloredImageData; - var coloredCanvasContext = imageCanvas.getContext("2d"); - var coloredImageData = coloredCanvasContext.getImageData(0, 0, width, ht); - var coloredImageDataVar = coloredImageData; - - $rootScope.coloredImageCanvasList[parseInt(bodyRegionId - 1)] = coloredImageDataVar; + $rootScope.coloredImageCanvasList[parseInt(bodyRegionId - 1)] = coloredImageDataVar; + } // if (($scope.ColoredImageSRC != null || $scope.ColoredImageSRC != undefined)) { @@ -4896,10 +4900,14 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo $scope.CalculateImageCordinates($rootScope.viewOrientationId); //3. - if ($scope.zoomInOut == 25) - $('#canvasDiv').scrollLeft(0) - else - $('#canvasDiv').scrollLeft($('#canvasDiv').width() / 2) + if ($scope.zoomInOut == 25) { + if ($('#canvasDiv') != null) + $('#canvasDiv').scrollLeft(0) + } + else { + if ($('#canvasDiv') != null) + $('#canvasDiv').scrollLeft($('#canvasDiv').width() / 2) + } //remove annotation speech bubble if ($('#dot').length > 0) {