diff options
author | Joas Schilling <coding@schilljs.com> | 2016-08-02 09:56:19 +0200 |
---|---|---|
committer | Joas Schilling <coding@schilljs.com> | 2016-08-02 10:50:21 +0200 |
commit | 62d009ad09fd6cdc80cc6b4dded42a8826b7a459 (patch) | |
tree | c4925bae61ed472db7a81f05a23e7b154db6aede /apps/workflowengine/js | |
parent | 7c1560d7870aafcdc8a93c5e12af4360a1ad6b71 (diff) | |
download | nextcloud-server-62d009ad09fd6cdc80cc6b4dded42a8826b7a459.tar.gz nextcloud-server-62d009ad09fd6cdc80cc6b4dded42a8826b7a459.zip |
Allow to define the operation
Diffstat (limited to 'apps/workflowengine/js')
-rw-r--r-- | apps/workflowengine/js/admin.js | 17 | ||||
-rw-r--r-- | apps/workflowengine/js/filesystemtagsplugin.js | 4 |
2 files changed, 9 insertions, 12 deletions
diff --git a/apps/workflowengine/js/admin.js b/apps/workflowengine/js/admin.js index 447237c5600..2c6fa54d87d 100644 --- a/apps/workflowengine/js/admin.js +++ b/apps/workflowengine/js/admin.js @@ -137,6 +137,7 @@ 'change .check-operator': 'checkChanged', 'change .check-value': 'checkChanged', 'change .operation-name': 'operationChanged', + 'change .operation-operation': 'operationChanged', 'click .button-reset': 'reset', 'click .button-save': 'save', 'click .button-add': 'add', @@ -269,7 +270,7 @@ return; } - if (key !== 'name') { + if (key !== 'name' && key !== 'operation') { console.warn('key "' + key + '" is no valid attribute'); return; } @@ -308,6 +309,8 @@ }, 7000, this.$el.find('.msg.success')); this.message = ''; } + + return this.$el; } }); @@ -324,10 +327,7 @@ events: { 'click .button-add-operation': 'add' }, - initialize: function() { - this._initialize('OCA\\WorkflowEngine\\Operation'); - }, - _initialize: function(classname) { + initialize: function(classname) { if (!OCA.WorkflowEngine.availablePlugins.length) { OCA.WorkflowEngine.availablePlugins = OC.Plugins.getPlugins('OCA.WorkflowEngine.CheckPlugins'); _.each(OCA.WorkflowEngine.availablePlugins, function(plugin) { @@ -346,11 +346,8 @@ var operation = this.collection.create(); this.renderOperation(operation); }, - renderOperation: function(operation){ - var subView = new OCA.WorkflowEngine.OperationView({ - model: operation - }), - operationsElement = this.$el.find('.operations'); + renderOperation: function(subView){ + var operationsElement = this.$el.find('.operations'); operationsElement.append(subView.$el); subView.render(); }, diff --git a/apps/workflowengine/js/filesystemtagsplugin.js b/apps/workflowengine/js/filesystemtagsplugin.js index 684b854f68a..bca890e3c31 100644 --- a/apps/workflowengine/js/filesystemtagsplugin.js +++ b/apps/workflowengine/js/filesystemtagsplugin.js @@ -49,7 +49,7 @@ placeholder: t('workflowengine', 'Select tag…'), query: _.debounce(function(query) { query.callback({ - results: OCA.WorkflowEngine.Plugins.FileSystemTagsPlugin.collection.filterByName(query.term) + results: OC.SystemTags.collection.filterByName(query.term) }); }, 100, true), id: function(element) { @@ -63,7 +63,7 @@ return OC.SystemTags.getDescriptiveTag(tag); }, formatSelection: function (tagId) { - tag = OCA.WorkflowEngine.Plugins.FileSystemTagsPlugin.collection.get(tagId); + var tag = OC.SystemTags.collection.get(tagId); return OC.SystemTags.getDescriptiveTag(tag); }, escapeMarkup: function(m) { |