diff --git a/apps/files/js/fileactionsmenu.js b/apps/files/js/fileactionsmenu.js
index b8022f1373..c3cd8bf8b7 100644
--- a/apps/files/js/fileactionsmenu.js
+++ b/apps/files/js/fileactionsmenu.js
@@ -10,24 +10,6 @@
(function() {
- var TEMPLATE_MENU =
- '
' +
- '{{#each items}}' +
- '- ' +
- '' +
- '
' +
- '{{/each}}' +
- '
';
-
/**
* Construct a new FileActionsMenu instance
* @constructs FileActionsMenu
@@ -49,10 +31,7 @@
},
template: function(data) {
- if (!OCA.Files.FileActionsMenu._TEMPLATE) {
- OCA.Files.FileActionsMenu._TEMPLATE = Handlebars.compile(TEMPLATE_MENU);
- }
- return OCA.Files.FileActionsMenu._TEMPLATE(data);
+ return OCA.Files.Templates['fileactionsmenu'](data);
},
/**
diff --git a/apps/files/js/templates.js b/apps/files/js/templates.js
index f05959ff98..0511873c8f 100644
--- a/apps/files/js/templates.js
+++ b/apps/files/js/templates.js
@@ -81,6 +81,43 @@ templates['file_action_trigger'] = template({"1":function(container,depth0,helpe
+ ((stack1 = helpers["if"].call(alias1,(depth0 != null ? depth0.displayName : depth0),{"name":"if","hash":{},"fn":container.program(8, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "")
+ "\n\n";
},"useData":true});
+templates['fileactionsmenu'] = template({"1":function(container,depth0,helpers,partials,data) {
+ var stack1, helper, alias1=depth0 != null ? depth0 : (container.nullContext || {}), alias2=helpers.helperMissing, alias3="function", alias4=container.escapeExpression;
+
+ return " \n \n \n";
+},"2":function(container,depth0,helpers,partials,data) {
+ var helper;
+
+ return "\n";
+},"4":function(container,depth0,helpers,partials,data) {
+ var stack1;
+
+ return ((stack1 = helpers["if"].call(depth0 != null ? depth0 : (container.nullContext || {}),(depth0 != null ? depth0.iconClass : depth0),{"name":"if","hash":{},"fn":container.program(5, data, 0),"inverse":container.program(7, data, 0),"data":data})) != null ? stack1 : "");
+},"5":function(container,depth0,helpers,partials,data) {
+ var helper;
+
+ return " \n";
+},"7":function(container,depth0,helpers,partials,data) {
+ return " \n";
+},"compiler":[7,">= 4.0.0"],"main":function(container,depth0,helpers,partials,data) {
+ var stack1;
+
+ return "\n"
+ + ((stack1 = helpers.each.call(depth0 != null ? depth0 : (container.nullContext || {}),(depth0 != null ? depth0.items : depth0),{"name":"each","hash":{},"fn":container.program(1, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "")
+ + "
\n";
+},"useData":true});
templates['filemultiselectmenu'] = template({"1":function(container,depth0,helpers,partials,data) {
var stack1, helper, alias1=depth0 != null ? depth0 : (container.nullContext || {}), alias2=helpers.helperMissing, alias3="function", alias4=container.escapeExpression;
diff --git a/apps/files/js/templates/fileactionsmenu.handlebars b/apps/files/js/templates/fileactionsmenu.handlebars
new file mode 100644
index 0000000000..d8d1b78fd8
--- /dev/null
+++ b/apps/files/js/templates/fileactionsmenu.handlebars
@@ -0,0 +1,17 @@
+
+ {{#each items}}
+ -
+
+
+ {{/each}}
+
diff --git a/apps/files/tests/js/fileactionsmenuSpec.js b/apps/files/tests/js/fileactionsmenuSpec.js
index f171f2848f..2d31f24a1b 100644
--- a/apps/files/tests/js/fileactionsmenuSpec.js
+++ b/apps/files/tests/js/fileactionsmenuSpec.js
@@ -203,7 +203,7 @@ describe('OCA.Files.FileActionsMenu tests', function() {
expect(displayNameStub.calledOnce).toEqual(true);
expect(displayNameStub.calledWith(menuContext)).toEqual(true);
- expect(menu.$el.find('a[data-action=Something]').text()).toEqual('Test');
+ expect(menu.$el.find('a[data-action=Something] span:not(.icon)').text()).toEqual('Test');
});
it('uses plain iconClass', function() {
fileActions.registerAction({