git://git.onelab.eu
/
unfold.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
6d197d7
)
Remove resource from the scheduler not only leases
author
Loic Baron
<loic.baron@lip6.fr>
Fri, 3 Apr 2015 15:40:38 +0000
(17:40 +0200)
committer
Loic Baron
<loic.baron@lip6.fr>
Fri, 3 Apr 2015 15:40:38 +0000
(17:40 +0200)
plugins/scheduler2/static/js/scheduler2.js
patch
|
blob
|
history
diff --git
a/plugins/scheduler2/static/js/scheduler2.js
b/plugins/scheduler2/static/js/scheduler2.js
index
939a2e2
..
6ef2549
100755
(executable)
--- a/
plugins/scheduler2/static/js/scheduler2.js
+++ b/
plugins/scheduler2/static/js/scheduler2.js
@@
-238,7
+238,18
@@
var SCHEDULER_COLWIDTH = 50;
manifold.raise_event($scope.instance.options.query_lease_uuid, FIELD_STATE_CHANGED, data);
/* Remove from local cache also, unless we listen to events from outside */
$scope._leases_by_resource[other.resource] = $.grep($scope._leases_by_resource[other.resource], function(x) { return x != other; });
manifold.raise_event($scope.instance.options.query_lease_uuid, FIELD_STATE_CHANGED, data);
/* Remove from local cache also, unless we listen to events from outside */
$scope._leases_by_resource[other.resource] = $.grep($scope._leases_by_resource[other.resource], function(x) { return x != other; });
-
+ /* Last lease removed for this resource -> remove the resource from the list */
+ if($scope._leases_by_resource.hasOwnProperty(other.resource) && $scope._leases_by_resource[other.resource].length == 0){
+ /* remove resource from the list of selected resources */
+ data_resource = {
+ state: STATE_SET,
+ key : null,
+ op : STATE_SET_REMOVE,
+ value: other.resource
+ };
+ manifold.raise_event($scope.instance.options.query_uuid, FIELD_STATE_CHANGED, data_resource);
+
+ }
}
$scope.select = function(index, model_lease, model_resource)
}
$scope.select = function(index, model_lease, model_resource)