mirror of
https://github.com/nasa/openmct.git
synced 2024-12-19 05:07:52 +00:00
Removed sysouts
This commit is contained in:
parent
a72f193e97
commit
23dbbf965c
@ -34,8 +34,7 @@ define(
|
|||||||
*/
|
*/
|
||||||
function InspectorController($scope, policyService) {
|
function InspectorController($scope, policyService) {
|
||||||
var domainObject = $scope.domainObject,
|
var domainObject = $scope.domainObject,
|
||||||
typeCapability = domainObject.getCapability('type'),
|
typeCapability = domainObject.getCapability('type');
|
||||||
listener;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Filters region parts to only those allowed by region policies
|
* Filters region parts to only those allowed by region policies
|
||||||
@ -53,16 +52,7 @@ define(
|
|||||||
$scope.regions = filterRegions(typeCapability.getDefinition().inspector || new InspectorRegion());
|
$scope.regions = filterRegions(typeCapability.getDefinition().inspector || new InspectorRegion());
|
||||||
}
|
}
|
||||||
|
|
||||||
//Listen for changes to object status that might necessitate
|
|
||||||
// recalculation of screen regions.
|
|
||||||
//listener =
|
|
||||||
// domainObject.getCapability("status").listen(setRegions);
|
|
||||||
|
|
||||||
setRegions();
|
setRegions();
|
||||||
|
|
||||||
$scope.$on("$destroy", function() {
|
|
||||||
listener();
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return InspectorController;
|
return InspectorController;
|
||||||
|
@ -243,18 +243,25 @@ define(
|
|||||||
// Also update when the represented domain object changes
|
// Also update when the represented domain object changes
|
||||||
// (to a different object)
|
// (to a different object)
|
||||||
$scope.$watch("domainObject", refresh);
|
$scope.$watch("domainObject", refresh);
|
||||||
$scope.$watch("domainObject", function(domainObject) {
|
|
||||||
if (domainObject){
|
function listenForStatusChange(object) {
|
||||||
if (statusListener) {
|
if (statusListener) {
|
||||||
statusListener();
|
statusListener();
|
||||||
listeners--;
|
}
|
||||||
console.log("directive listeners " + listeners);
|
statusListener = object.getCapability("status").listen(refresh);
|
||||||
}
|
}
|
||||||
statusListener = domainObject.getCapability("status").listen(refresh);
|
|
||||||
listeners++;
|
/**
|
||||||
console.log("directive listeners " + listeners);
|
* Add a listener for status changes to the object itself.
|
||||||
|
*/
|
||||||
|
$scope.$watch("domainObject", function(domainObject, oldDomainObject) {
|
||||||
|
if (domainObject!==oldDomainObject){
|
||||||
|
listenForStatusChange(domainObject);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
if ($scope.domainObject) {
|
||||||
|
listenForStatusChange($scope.domainObject);
|
||||||
|
}
|
||||||
|
|
||||||
// Finally, also update when there is a new version of that
|
// Finally, also update when there is a new version of that
|
||||||
// same domain object; these changes should be tracked in the
|
// same domain object; these changes should be tracked in the
|
||||||
@ -267,8 +274,6 @@ define(
|
|||||||
$scope.$on("$destroy", function () {
|
$scope.$on("$destroy", function () {
|
||||||
if (statusListener) {
|
if (statusListener) {
|
||||||
statusListener();
|
statusListener();
|
||||||
listeners--;
|
|
||||||
console.log("directive listeners " + listeners);
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user