Removed sysouts

This commit is contained in:
Henry
2016-04-18 16:42:22 -07:00
parent e6bbc3442b
commit 4b786d3536
2 changed files with 18 additions and 23 deletions

View File

@@ -241,18 +241,25 @@ define(
// Also update when the represented domain object changes
// (to a different object)
$scope.$watch("domainObject", refresh);
$scope.$watch("domainObject", function(domainObject) {
if (domainObject){
if (statusListener) {
statusListener();
listeners--;
console.log("directive listeners " + listeners);
}
statusListener = domainObject.getCapability("status").listen(refresh);
listeners++;
console.log("directive listeners " + listeners);
function listenForStatusChange(object) {
if (statusListener) {
statusListener();
}
statusListener = object.getCapability("status").listen(refresh);
}
/**
* 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
// same domain object; these changes should be tracked in the
@@ -265,8 +272,6 @@ define(
$scope.$on("$destroy", function () {
if (statusListener) {
statusListener();
listeners--;
console.log("directive listeners " + listeners);
}
});