Make sure each plugin is only added once
This commit is contained in:
parent
c425a677b2
commit
df3ca567ad
|
@ -74,12 +74,6 @@
|
|||
}
|
||||
});
|
||||
|
||||
/**
|
||||
* @class OCA.WorkflowEngine.AvailableCheck
|
||||
*/
|
||||
OCA.WorkflowEngine.AvailableCheck =
|
||||
OC.Backbone.Model.extend({});
|
||||
|
||||
/**
|
||||
* .d8888b. 888 888 888 d8b
|
||||
* d88P Y88b 888 888 888 Y8P
|
||||
|
@ -335,12 +329,14 @@
|
|||
this._initialize('OCA\\WorkflowEngine\\Operation');
|
||||
},
|
||||
_initialize: function(classname) {
|
||||
OCA.WorkflowEngine.availablePlugins = OC.Plugins.getPlugins('OCA.WorkflowEngine.CheckPlugins');
|
||||
_.each(OCA.WorkflowEngine.availablePlugins, function(plugin) {
|
||||
if (_.isFunction(plugin.getCheck)) {
|
||||
OCA.WorkflowEngine.availableChecks.push(plugin.getCheck());
|
||||
}
|
||||
});
|
||||
if (!OCA.WorkflowEngine.availablePlugins.length) {
|
||||
OCA.WorkflowEngine.availablePlugins = OC.Plugins.getPlugins('OCA.WorkflowEngine.CheckPlugins');
|
||||
_.each(OCA.WorkflowEngine.availablePlugins, function(plugin) {
|
||||
if (_.isFunction(plugin.getCheck)) {
|
||||
OCA.WorkflowEngine.availableChecks.push(plugin.getCheck(classname));
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
this.collection.fetch({data: {
|
||||
'class': classname
|
||||
|
|
Loading…
Reference in New Issue