Move detailsview to compiled handlebars

Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
This commit is contained in:
Roeland Jago Douma 2018-10-01 18:58:12 +02:00
parent a0368608f0
commit 187953153a
No known key found for this signature in database
GPG key ID: F941078878347C0C
3 changed files with 36 additions and 22 deletions

View file

@ -9,22 +9,6 @@
*/
(function() {
var TEMPLATE =
' <div class="detailFileInfoContainer">' +
' </div>' +
' {{#if tabHeaders}}' +
' <ul class="tabHeaders">' +
' {{#each tabHeaders}}' +
' <li class="tabHeader" data-tabid="{{tabId}}" tabindex="0">' +
' <a href="#" tabindex="-1">{{label}}</a>' +
' </li>' +
' {{/each}}' +
' </ul>' +
' {{/if}}' +
' <div class="tabsContainer">' +
' </div>' +
' <a class="close icon-close" href="#"><span class="hidden-visually">{{closeLabel}}</span></a>';
/**
* @class OCA.Files.DetailsView
* @classdesc
@ -37,8 +21,6 @@
tabName: 'div',
className: 'detailsView scroll-container',
_template: null,
/**
* List of detail tab views
*
@ -107,10 +89,7 @@
},
template: function(vars) {
if (!this._template) {
this._template = Handlebars.compile(TEMPLATE);
}
return this._template(vars);
return OCA.Files.Templates['detailsview'](vars);
},
/**

View file

@ -1,5 +1,28 @@
(function() {
var template = Handlebars.template, templates = OCA.Files.Templates = OCA.Files.Templates || {};
templates['detailsview'] = template({"1":function(container,depth0,helpers,partials,data) {
var stack1;
return "<ul class=\"tabHeaders\">\n"
+ ((stack1 = helpers.each.call(depth0 != null ? depth0 : (container.nullContext || {}),(depth0 != null ? depth0.tabHeaders : depth0),{"name":"each","hash":{},"fn":container.program(2, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "")
+ "</ul>\n";
},"2":function(container,depth0,helpers,partials,data) {
var helper, alias1=depth0 != null ? depth0 : (container.nullContext || {}), alias2=helpers.helperMissing, alias3="function", alias4=container.escapeExpression;
return " <li class=\"tabHeader\" data-tabid=\""
+ alias4(((helper = (helper = helpers.tabId || (depth0 != null ? depth0.tabId : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"tabId","hash":{},"data":data}) : helper)))
+ "\" tabindex=\"0\">\n <a href=\"#\" tabindex=\"-1\">"
+ alias4(((helper = (helper = helpers.label || (depth0 != null ? depth0.label : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"label","hash":{},"data":data}) : helper)))
+ "</a>\n </li>\n";
},"compiler":[7,">= 4.0.0"],"main":function(container,depth0,helpers,partials,data) {
var stack1, helper, alias1=depth0 != null ? depth0 : (container.nullContext || {});
return "<div class=\"detailFileInfoContainer\"></div>\n"
+ ((stack1 = helpers["if"].call(alias1,(depth0 != null ? depth0.tabHeaders : depth0),{"name":"if","hash":{},"fn":container.program(1, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "")
+ "<div class=\"tabsContainer\"></div>\n<a class=\"close icon-close\" href=\"#\"><span class=\"hidden-visually\">"
+ container.escapeExpression(((helper = (helper = helpers.closeLabel || (depth0 != null ? depth0.closeLabel : depth0)) != null ? helper : helpers.helperMissing),(typeof helper === "function" ? helper.call(alias1,{"name":"closeLabel","hash":{},"data":data}) : helper)))
+ "</span></a>\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;

View file

@ -0,0 +1,12 @@
<div class="detailFileInfoContainer"></div>
{{#if tabHeaders}}
<ul class="tabHeaders">
{{#each tabHeaders}}
<li class="tabHeader" data-tabid="{{tabId}}" tabindex="0">
<a href="#" tabindex="-1">{{label}}</a>
</li>
{{/each}}
</ul>
{{/if}}
<div class="tabsContainer"></div>
<a class="close icon-close" href="#"><span class="hidden-visually">{{closeLabel}}</span></a>