diff options
author | Julius Härtl <jus@bitgrid.net> | 2018-10-18 15:47:18 +0200 |
---|---|---|
committer | Julius Härtl <jus@bitgrid.net> | 2018-10-18 15:54:17 +0200 |
commit | 45804b5bef932ba86ff5a28a40f1a7ebcb7c5290 (patch) | |
tree | f34ec68f71108a93a43781d72fcb12b1901a5d45 /apps | |
parent | 302a5d81714c9aca3fa38fad9fe8879fb867c3e8 (diff) | |
download | nextcloud-server-45804b5bef932ba86ff5a28a40f1a7ebcb7c5290.tar.gz nextcloud-server-45804b5bef932ba86ff5a28a40f1a7ebcb7c5290.zip |
Add icon to file sidebar tabs
Signed-off-by: Julius Härtl <jus@bitgrid.net>
Diffstat (limited to 'apps')
-rw-r--r-- | apps/comments/js/commentstabview.js | 4 | ||||
-rw-r--r-- | apps/files/js/detailsview.js | 3 | ||||
-rw-r--r-- | apps/files/js/detailtabview.js | 9 | ||||
-rw-r--r-- | apps/files/js/templates.js | 12 | ||||
-rw-r--r-- | apps/files/js/templates/detailsview.handlebars | 1 | ||||
-rw-r--r-- | apps/files_sharing/js/sharetabview.js | 4 |
6 files changed, 30 insertions, 3 deletions
diff --git a/apps/comments/js/commentstabview.js b/apps/comments/js/commentstabview.js index 35e73d3f4a6..8ea4dbc2ff2 100644 --- a/apps/comments/js/commentstabview.js +++ b/apps/comments/js/commentstabview.js @@ -89,6 +89,10 @@ return t('comments', 'Comments'); }, + getIcon: function() { + return 'icon-comment'; + }, + setFileInfo: function(fileInfo) { if (fileInfo) { this.model = fileInfo; diff --git a/apps/files/js/detailsview.js b/apps/files/js/detailsview.js index 2a5d589a730..ad5c9993524 100644 --- a/apps/files/js/detailsview.js +++ b/apps/files/js/detailsview.js @@ -122,7 +122,8 @@ templateVars.tabHeaders = _.map(this._tabViews, function(tabView, i) { return { tabId: tabView.id, - label: tabView.getLabel() + label: tabView.getLabel(), + tabIcon: tabView.getIcon() }; }); diff --git a/apps/files/js/detailtabview.js b/apps/files/js/detailtabview.js index 0bd34a88188..a66cedbc15d 100644 --- a/apps/files/js/detailtabview.js +++ b/apps/files/js/detailtabview.js @@ -50,6 +50,15 @@ }, /** + * Returns the tab label + * + * @return {String}|{null} icon class + */ + getIcon: function() { + return null + }, + + /** * returns the jQuery object for HTML output * * @returns {jQuery} diff --git a/apps/files/js/templates.js b/apps/files/js/templates.js index 0511873c8fb..a2bdae5b3c4 100644 --- a/apps/files/js/templates.js +++ b/apps/files/js/templates.js @@ -7,13 +7,21 @@ templates['detailsview'] = template({"1":function(container,depth0,helpers,parti + ((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; + var stack1, 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\">" + + "\" tabindex=\"0\">\n " + + ((stack1 = helpers["if"].call(alias1,(depth0 != null ? depth0.tabIcon : depth0),{"name":"if","hash":{},"fn":container.program(3, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "") + + "\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"; +},"3":function(container,depth0,helpers,partials,data) { + var helper; + + return "<span class=\"icon " + + container.escapeExpression(((helper = (helper = helpers.tabIcon || (depth0 != null ? depth0.tabIcon : depth0)) != null ? helper : helpers.helperMissing),(typeof helper === "function" ? helper.call(depth0 != null ? depth0 : (container.nullContext || {}),{"name":"tabIcon","hash":{},"data":data}) : helper))) + + "\"></span>"; },"compiler":[7,">= 4.0.0"],"main":function(container,depth0,helpers,partials,data) { var stack1, helper, alias1=depth0 != null ? depth0 : (container.nullContext || {}); diff --git a/apps/files/js/templates/detailsview.handlebars b/apps/files/js/templates/detailsview.handlebars index 841a8fe25fe..4d489e4fa0d 100644 --- a/apps/files/js/templates/detailsview.handlebars +++ b/apps/files/js/templates/detailsview.handlebars @@ -3,6 +3,7 @@ <ul class="tabHeaders"> {{#each tabHeaders}} <li class="tabHeader" data-tabid="{{tabId}}" tabindex="0"> + {{#if tabIcon}}<span class="icon {{tabIcon}}"></span>{{/if}} <a href="#" tabindex="-1">{{label}}</a> </li> {{/each}} diff --git a/apps/files_sharing/js/sharetabview.js b/apps/files_sharing/js/sharetabview.js index fc7f2c5f045..3944293d5c1 100644 --- a/apps/files_sharing/js/sharetabview.js +++ b/apps/files_sharing/js/sharetabview.js @@ -32,6 +32,10 @@ return t('files_sharing', 'Sharing'); }, + getIcon: function() { + return 'icon-shared'; + }, + /** * Renders this details view */ |