mirror of
https://github.com/nextcloud/server.git
synced 2026-05-28 04:32:30 -04:00
Move the filemultiselectmenu over to compiled handlebars
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
This commit is contained in:
parent
335efcc43b
commit
40934ab15b
3 changed files with 45 additions and 17 deletions
|
|
@ -9,21 +9,6 @@
|
|||
*/
|
||||
|
||||
(function() {
|
||||
var TEMPLATE_MENU =
|
||||
'<ul>' +
|
||||
'{{#each items}}' +
|
||||
'<li class="item-{{name}}">' +
|
||||
'<a href="#" class="menuitem action {{name}} permanent" data-action="{{name}}">' +
|
||||
'{{#if iconClass}}' +
|
||||
'<span class="icon {{iconClass}}"></span>' +
|
||||
'{{else}}' +
|
||||
'<span class="no-icon"></span>' +
|
||||
'{{/if}}' +
|
||||
'<span class="label">{{displayName}}</span>' +
|
||||
'</a></li>' +
|
||||
'{{/each}}' +
|
||||
'</ul>';
|
||||
|
||||
var FileMultiSelectMenu = OC.Backbone.View.extend({
|
||||
tagName: 'div',
|
||||
className: 'filesSelectMenu popovermenu bubble menu-center',
|
||||
|
|
@ -34,12 +19,12 @@
|
|||
events: {
|
||||
'click a.action': '_onClickAction'
|
||||
},
|
||||
template: Handlebars.compile(TEMPLATE_MENU),
|
||||
|
||||
/**
|
||||
* Renders the menu with the currently set items
|
||||
*/
|
||||
render: function() {
|
||||
this.$el.html(this.template({
|
||||
this.$el.html(OCA.Files.Templates['filemultiselectmenu']({
|
||||
items: this._scopes
|
||||
}));
|
||||
},
|
||||
|
|
|
|||
|
|
@ -1,5 +1,34 @@
|
|||
(function() {
|
||||
var template = Handlebars.template, templates = OCA.Files.Templates = OCA.Files.Templates || {};
|
||||
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;
|
||||
|
||||
return " <li class=\"item-"
|
||||
+ alias4(((helper = (helper = helpers.name || (depth0 != null ? depth0.name : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"name","hash":{},"data":data}) : helper)))
|
||||
+ "\">\n <a href=\"#\" class=\"menuitem action "
|
||||
+ alias4(((helper = (helper = helpers.name || (depth0 != null ? depth0.name : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"name","hash":{},"data":data}) : helper)))
|
||||
+ " permanent\" data-action=\""
|
||||
+ alias4(((helper = (helper = helpers.name || (depth0 != null ? depth0.name : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"name","hash":{},"data":data}) : helper)))
|
||||
+ "\">\n"
|
||||
+ ((stack1 = helpers["if"].call(alias1,(depth0 != null ? depth0.iconClass : depth0),{"name":"if","hash":{},"fn":container.program(2, data, 0),"inverse":container.program(4, data, 0),"data":data})) != null ? stack1 : "")
|
||||
+ " <span class=\"label\">"
|
||||
+ alias4(((helper = (helper = helpers.displayName || (depth0 != null ? depth0.displayName : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"displayName","hash":{},"data":data}) : helper)))
|
||||
+ "</span>\n </a>\n </li>\n";
|
||||
},"2":function(container,depth0,helpers,partials,data) {
|
||||
var helper;
|
||||
|
||||
return " <span class=\"icon "
|
||||
+ container.escapeExpression(((helper = (helper = helpers.iconClass || (depth0 != null ? depth0.iconClass : depth0)) != null ? helper : helpers.helperMissing),(typeof helper === "function" ? helper.call(depth0 != null ? depth0 : (container.nullContext || {}),{"name":"iconClass","hash":{},"data":data}) : helper)))
|
||||
+ "\"></span>\n";
|
||||
},"4":function(container,depth0,helpers,partials,data) {
|
||||
return " <span class=\"no-icon\"></span>\n";
|
||||
},"compiler":[7,">= 4.0.0"],"main":function(container,depth0,helpers,partials,data) {
|
||||
var stack1;
|
||||
|
||||
return "<ul>\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 : "")
|
||||
+ "</ul>\n";
|
||||
},"useData":true});
|
||||
templates['filesummary'] = template({"compiler":[7,">= 4.0.0"],"main":function(container,depth0,helpers,partials,data) {
|
||||
var helper;
|
||||
|
||||
|
|
|
|||
14
apps/files/js/templates/filemultiselectmenu.handlebars
Normal file
14
apps/files/js/templates/filemultiselectmenu.handlebars
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
<ul>
|
||||
{{#each items}}
|
||||
<li class="item-{{name}}">
|
||||
<a href="#" class="menuitem action {{name}} permanent" data-action="{{name}}">
|
||||
{{#if iconClass}}
|
||||
<span class="icon {{iconClass}}"></span>
|
||||
{{else}}
|
||||
<span class="no-icon"></span>
|
||||
{{/if}}
|
||||
<span class="label">{{displayName}}</span>
|
||||
</a>
|
||||
</li>
|
||||
{{/each}}
|
||||
</ul>
|
||||
Loading…
Reference in a new issue