X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=plugins%2Fscheduler2%2Fstatic%2Fjs%2Fscheduler2.js;h=939a2e23d922f30c2ae6efb03e16eeaa1bda2ef9;hb=7426a25d89f0a5c02abfcc22e2f8eb9458a66966;hp=a13856a98a41f7c220dfbba1c502918b5c52ff9c;hpb=fcb529f9c21f0868896e7721eafad153a4a071bb;p=unfold.git diff --git a/plugins/scheduler2/static/js/scheduler2.js b/plugins/scheduler2/static/js/scheduler2.js index a13856a9..939a2e23 100755 --- a/plugins/scheduler2/static/js/scheduler2.js +++ b/plugins/scheduler2/static/js/scheduler2.js @@ -197,10 +197,21 @@ var SCHEDULER_COLWIDTH = 50; value: new_lease } manifold.raise_event($scope.instance.options.query_lease_uuid, FIELD_STATE_CHANGED, data); + /* Add to local cache also, unless we listen to events from outside */ - if (!(resource_urn in $scope._leases_by_resource)) + if (!(resource_urn in $scope._leases_by_resource)){ $scope._leases_by_resource[resource_urn] = []; + /* Add the resource of the selected timeslot to the pending list */ + data_resource = { + state: STATE_SET, + key : null, + op : STATE_SET_ADD, + value: resource_urn + }; + manifold.raise_event($scope.instance.options.query_uuid, FIELD_STATE_CHANGED, data_resource); + } $scope._leases_by_resource[resource_urn].push(new_lease); + } $scope._remove_lease = function(other)