From 187953153a76e67d4ffa7b3f5af4169665b5d653 Mon Sep 17 00:00:00 2001 From: Roeland Jago Douma Date: Mon, 1 Oct 2018 18:58:12 +0200 Subject: Move detailsview to compiled handlebars Signed-off-by: Roeland Jago Douma --- apps/files/js/detailsview.js | 23 +---------------------- apps/files/js/templates.js | 23 +++++++++++++++++++++++ apps/files/js/templates/detailsview.handlebars | 12 ++++++++++++ 3 files changed, 36 insertions(+), 22 deletions(-) create mode 100644 apps/files/js/templates/detailsview.handlebars (limited to 'apps') diff --git a/apps/files/js/detailsview.js b/apps/files/js/detailsview.js index aed1736693a..2a5d589a730 100644 --- a/apps/files/js/detailsview.js +++ b/apps/files/js/detailsview.js @@ -9,22 +9,6 @@ */ (function() { - var TEMPLATE = - '
' + - '
' + - ' {{#if tabHeaders}}' + - ' ' + - ' {{/if}}' + - '
' + - '
' + - ' {{closeLabel}}'; - /** * @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); }, /** diff --git a/apps/files/js/templates.js b/apps/files/js/templates.js index 9e93d5b5ac3..4b78ffc8c98 100644 --- a/apps/files/js/templates.js +++ b/apps/files/js/templates.js @@ -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 "\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 "
  • \n " + + 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))) + + "\n
  • \n"; +},"compiler":[7,">= 4.0.0"],"main":function(container,depth0,helpers,partials,data) { + var stack1, helper, alias1=depth0 != null ? depth0 : (container.nullContext || {}); + + return "
    \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 : "") + + "
    \n" + + 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))) + + "\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/detailsview.handlebars b/apps/files/js/templates/detailsview.handlebars new file mode 100644 index 00000000000..841a8fe25fe --- /dev/null +++ b/apps/files/js/templates/detailsview.handlebars @@ -0,0 +1,12 @@ +
    +{{#if tabHeaders}} + +{{/if}} +
    +{{closeLabel}} -- cgit v1.2.3