fixed scheduler bugs
[unfold.git] / plugins / scheduler2 / static / js / scheduler2.js
index 77545c0..0b5339f 100755 (executable)
@@ -226,7 +226,7 @@ var SCHEDULER_COLWIDTH = 50;
             }\r
             manifold.raise_event($scope.instance.options.query_lease_uuid, FIELD_STATE_CHANGED, data);\r
             /* Remove from local cache also, unless we listen to events from outside */\r
-            $.grep($scope._leases_by_resource[other.resource], function(x) { return x != other; });\r
+            $scope._leases_by_resource[other.resource] = $.grep($scope._leases_by_resource[other.resource], function(x) { return x != other; });\r
 \r
         }\r
 \r
@@ -278,7 +278,7 @@ var SCHEDULER_COLWIDTH = 50;
                             }\r
                             manifold.raise_event($scope.instance.options.query_lease_uuid, FIELD_STATE_CHANGED, data);\r
                             /* Remove from local cache also, unless we listen to events from outside */\r
-                            $.grep($scope._leases_by_resource[model_resource.urn], function(x) { return x != other; });\r
+                            $scope._leases_by_resource[model_resource.urn] = $.grep($scope._leases_by_resource[model_resource.urn], function(x) { return x != other; });\r
                             return false; // ~ break\r
                         });\r
         \r
@@ -305,9 +305,9 @@ var SCHEDULER_COLWIDTH = 50;
                                 op   : STATE_SET_REMOVE,\r
                                 value: other_key\r
                             }\r
-                            manifold.raise_event($scope.instance.options.query_lease_uuid, FIELD_STATE_CHANGED, other_key);\r
+                            manifold.raise_event($scope.instance.options.query_lease_uuid, FIELD_STATE_CHANGED, data);\r
                             /* Remove from local cache also, unless we listen to events from outside */\r
-                            $.grep($scope._leases_by_resource[model_resource.urn], function(x) { return x != other; });\r
+                            $scope._leases_by_resource[model_resource.urn] = $.grep($scope._leases_by_resource[model_resource.urn], function(x) { return x != other; });\r
                             return false; // ~ break\r
                         });\r
                     }\r