diff options
author | Roeland Jago Douma <roeland@famdouma.nl> | 2018-10-01 18:58:12 +0200 |
---|---|---|
committer | Roeland Jago Douma <roeland@famdouma.nl> | 2018-10-04 09:53:44 +0200 |
commit | 187953153a76e67d4ffa7b3f5af4169665b5d653 (patch) | |
tree | a7505e763f11ddfc297fb2afe1f5d6ffb4c51abb | |
parent | a0368608f0fd3d3d1b6107d6826cf78bc5fbabee (diff) | |
download | nextcloud-server-187953153a76e67d4ffa7b3f5af4169665b5d653.tar.gz nextcloud-server-187953153a76e67d4ffa7b3f5af4169665b5d653.zip |
Move detailsview to compiled handlebars
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
-rw-r--r-- | apps/files/js/detailsview.js | 23 | ||||
-rw-r--r-- | apps/files/js/templates.js | 23 | ||||
-rw-r--r-- | apps/files/js/templates/detailsview.handlebars | 12 |
3 files changed, 36 insertions, 22 deletions
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 = - ' <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); }, /** 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 "<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; 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 @@ +<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> |