mirror of
https://github.com/nasa/openmct.git
synced 2024-12-19 05:07:52 +00:00
[Selection] Add ActionRegistry
This commit is contained in:
parent
106632c21c
commit
9e19296b14
17
src/ui/ActionRegistry.js
Normal file
17
src/ui/ActionRegistry.js
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
define([], function () {
|
||||||
|
function ActionRegistry() {
|
||||||
|
this.providers = [];
|
||||||
|
}
|
||||||
|
|
||||||
|
ActionRegistry.prototype.get = function (context) {
|
||||||
|
return this.providers.filter(function (provider) {
|
||||||
|
return provider.appliesTo(context);
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
ActionRegistry.prototype.addProvider = function (provider) {
|
||||||
|
this.providers.push(provider);
|
||||||
|
};
|
||||||
|
|
||||||
|
return ActionRegistry;
|
||||||
|
});
|
Loading…
Reference in New Issue
Block a user