Commit 41f3cfcc6968bbd21d67fe6fc4714597f27573af
1 parent
6c80688f
resolve DA sometimes not load issue
Showing
1 changed file
with
40 additions
and
36 deletions
400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js
... | ... | @@ -555,40 +555,25 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l |
555 | 555 | //0.3 |
556 | 556 | var daBodyviewElement = angular.element(document.getElementById("daBodyview")); |
557 | 557 | |
558 | - $timeout(function () { | |
558 | + $timeout(function () | |
559 | + { | |
559 | 560 | $compile(daBodyviewElement.contents())($scope); |
560 | 561 | |
561 | - console.log('html is compiled' + document.getElementById('daView')) | |
562 | - if (document.getElementById('daView') != null) { | |
563 | - | |
564 | - //0.4 added some stylesheets | |
565 | - $('#daBodyview').css("height", (parseInt($(window).outerHeight())-62-20)); | |
566 | - | |
567 | - $('#daBodyview').css("width", $(window).outerWidth()); | |
568 | - | |
569 | - //1. load navigator man first | |
570 | - console.log('before LoadBodyViewNavigatorImage call') | |
571 | - $scope.LoadBodyViewNavigatorImage(); | |
572 | - | |
573 | - //$rootScope.loadSearchData(); | |
574 | - | |
575 | - $scope.currentTitleFromJson = $rootScope.getLocalStorageValue("currentViewTitle"); | |
562 | + console.log('html is compiled ' + document.getElementById('daView')) | |
576 | 563 | |
577 | - $scope.layerNumber = 0; | |
578 | - | |
579 | - //2. | |
580 | - | |
581 | - | |
582 | - console.log('currentBodyViewId just before sending: ' + currentBodyViewId); | |
583 | - $scope.loadBodyViewData(currentBodyViewId); | |
564 | + if (document.getElementById('daView') != null) { | |
584 | 565 | |
585 | - //2. load bodyRegion data | |
586 | - $rootScope.isLoading = true; | |
587 | - $rootScope.voId = $rootScope.getLocalStorageValue("currentBodyViewId"); | |
566 | + $scope.loadDAView(currentBodyViewId); | |
588 | 567 | } |
589 | - //$('#daBodyview').css("height", $(window).outerHeight()); | |
568 | + else | |
569 | + { | |
570 | + $compile(daBodyviewElement.contents())($scope); | |
571 | + console.log('html is compiled in else ' + document.getElementById('daView')) | |
590 | 572 | |
591 | - //$('#daBodyview').css("width", $(window).outerWidth()); | |
573 | + $scope.loadDAView(currentBodyViewId); | |
574 | + | |
575 | + } | |
576 | + | |
592 | 577 | |
593 | 578 | if ($('#daImagePanel').offset().top == 0) |
594 | 579 | $('#daImagePanel').css("top", '70px'); |
... | ... | @@ -605,16 +590,35 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l |
605 | 590 | |
606 | 591 | $location.path('/'); |
607 | 592 | |
608 | - /*relaoding unavailable data for resolving refesh issue*/ | |
609 | - /* console.log('Reloading json data for body view => BROWSER REFRESH ISSUE...'); | |
610 | - $scope.loadDissectibleAnatomyData(); | |
611 | - | |
612 | - if ((typeof($rootScope.MenuModuleName) == "undefined") || $rootScope.MenuModuleName == null) { | |
613 | - $rootScope.MenuModuleName = "DA"; | |
614 | - }*/ | |
593 | + | |
594 | + } | |
595 | + } | |
615 | 596 | |
597 | + $scope.loadDAView = function (currentBodyViewId) | |
598 | + { | |
599 | + | |
600 | + //0.4 added some stylesheets | |
601 | + $('#daBodyview').css("height", (parseInt($(window).outerHeight()) - 62 - 20)); | |
602 | + | |
603 | + $('#daBodyview').css("width", $(window).outerWidth()); | |
604 | + | |
605 | + //1. load navigator man first | |
606 | + console.log('before LoadBodyViewNavigatorImage call') | |
607 | + $scope.LoadBodyViewNavigatorImage(); | |
608 | + | |
609 | + | |
610 | + $scope.currentTitleFromJson = $rootScope.getLocalStorageValue("currentViewTitle"); | |
611 | + | |
612 | + $scope.layerNumber = 0; | |
613 | + | |
614 | + //2. | |
615 | + console.log('currentBodyViewId just before sending: ' + currentBodyViewId); | |
616 | + $scope.loadBodyViewData(currentBodyViewId); | |
617 | + | |
618 | + //2. load bodyRegion data | |
619 | + $rootScope.isLoading = true; | |
620 | + $rootScope.voId = $rootScope.getLocalStorageValue("currentBodyViewId"); | |
616 | 621 | |
617 | - } | |
618 | 622 | } |
619 | 623 | |
620 | 624 | angular.element(document).ready(function (e) { | ... | ... |