Move detailsview to compiled handlebars
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
This commit is contained in:
parent
a0368608f0
commit
187953153a
3 changed files with 36 additions and 22 deletions
|
@ -9,22 +9,6 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
(function() {
|
(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
|
* @class OCA.Files.DetailsView
|
||||||
* @classdesc
|
* @classdesc
|
||||||
|
@ -37,8 +21,6 @@
|
||||||
tabName: 'div',
|
tabName: 'div',
|
||||||
className: 'detailsView scroll-container',
|
className: 'detailsView scroll-container',
|
||||||
|
|
||||||
_template: null,
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* List of detail tab views
|
* List of detail tab views
|
||||||
*
|
*
|
||||||
|
@ -107,10 +89,7 @@
|
||||||
},
|
},
|
||||||
|
|
||||||
template: function(vars) {
|
template: function(vars) {
|
||||||
if (!this._template) {
|
return OCA.Files.Templates['detailsview'](vars);
|
||||||
this._template = Handlebars.compile(TEMPLATE);
|
|
||||||
}
|
|
||||||
return this._template(vars);
|
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -1,5 +1,28 @@
|
||||||
(function() {
|
(function() {
|
||||||
var template = Handlebars.template, templates = OCA.Files.Templates = OCA.Files.Templates || {};
|
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) {
|
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;
|
var stack1, helper, alias1=depth0 != null ? depth0 : (container.nullContext || {}), alias2=helpers.helperMissing, alias3="function", alias4=container.escapeExpression;
|
||||||
|
|
||||||
|
|
12
apps/files/js/templates/detailsview.handlebars
Normal file
12
apps/files/js/templates/detailsview.handlebars
Normal 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>
|
Loading…
Reference in a new issue