mirror of
https://github.com/nasa/openmct.git
synced 2024-12-19 21:27:52 +00:00
[Selection] Add ViewRegistry
This commit is contained in:
parent
7341ed9d03
commit
0a64e9f515
18
src/ui/ViewRegistry.js
Normal file
18
src/ui/ViewRegistry.js
Normal file
@ -0,0 +1,18 @@
|
||||
define(['zepto'], function () {
|
||||
function ViewRegistry() {
|
||||
this.providers = [];
|
||||
}
|
||||
|
||||
ViewRegistry.prototype.get = function (item) {
|
||||
return this.providers.filter(function (provider) {
|
||||
return provider.canView(item);
|
||||
});
|
||||
};
|
||||
|
||||
ViewRegistry.prototype.addProvider = function (provider) {
|
||||
this.providers.push(provider);
|
||||
};
|
||||
|
||||
return ViewRegistry;
|
||||
|
||||
});
|
Loading…
Reference in New Issue
Block a user