diff options
author | John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com> | 2019-03-14 18:01:44 +0100 |
---|---|---|
committer | John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com> | 2019-03-21 08:14:16 +0100 |
commit | 4ad922d4f6ea7f08c54223587964bb93ae064ce5 (patch) | |
tree | 25302403d16af2fbea98d47129408cd13776d7d4 /apps/files | |
parent | 6ea5beccd7f74bb13fdec02b5720e1ef2a5652f2 (diff) | |
download | nextcloud-server-4ad922d4f6ea7f08c54223587964bb93ae064ce5.tar.gz nextcloud-server-4ad922d4f6ea7f08c54223587964bb93ae064ce5.zip |
Show sharing in menu in grid view
Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
Diffstat (limited to 'apps/files')
-rw-r--r-- | apps/files/css/files.scss | 15 | ||||
-rw-r--r-- | apps/files/js/fileactionsmenu.js | 12 | ||||
-rw-r--r-- | apps/files/js/templates.js | 18 | ||||
-rw-r--r-- | apps/files/js/templates/fileactionsmenu.handlebars | 2 |
4 files changed, 36 insertions, 11 deletions
diff --git a/apps/files/css/files.scss b/apps/files/css/files.scss index 379ef0d7a6e..e62e6a46ec9 100644 --- a/apps/files/css/files.scss +++ b/apps/files/css/files.scss @@ -544,6 +544,9 @@ a.action > img { opacity: .3; &.action-share { padding: 17px 14px; + > span:not(.icon) { + display: none; + } .avatar { display: inline-block; vertical-align: middle; @@ -936,6 +939,18 @@ table.dragshadow td.size { } } + .fileActionsMenu { + // force show the sharing entry in the dropdown menu + .action-share-container.hidden { + display: block !important; + // avatar in shared by user dropdown menu + .action-share img { + padding: 6px; + border-radius: 50%; + } + } + } + form { padding: 3px 14px; border-radius: var(--border-radius); diff --git a/apps/files/js/fileactionsmenu.js b/apps/files/js/fileactionsmenu.js index c3cd8bf8b70..16c4cc0d784 100644 --- a/apps/files/js/fileactionsmenu.js +++ b/apps/files/js/fileactionsmenu.js @@ -84,10 +84,7 @@ ); var items = _.filter(actions, function(actionSpec) { - return ( - actionSpec.type === OCA.Files.FileActions.TYPE_DROPDOWN && - (!defaultAction || actionSpec.name !== defaultAction.name) - ); + return !defaultAction || actionSpec.name !== defaultAction.name; }); items = _.map(items, function(item) { if (_.isFunction(item.displayName)) { @@ -99,6 +96,12 @@ item = _.extend({}, item); item.iconClass = item.iconClass(fileName, self._context); } + if (_.isFunction(item.icon)) { + var fileName = self._context.$file.attr('data-file'); + item = _.extend({}, item); + item.icon = item.icon(fileName, self._context); + } + item.inline = item.type === OCA.Files.FileActions.TYPE_INLINE return item; }); items = items.sort(function(actionA, actionB) { @@ -109,6 +112,7 @@ } return orderA - orderB; }); + items = _.map(items, function(item) { item.nameLowerCase = item.name.toLowerCase(); return item; diff --git a/apps/files/js/templates.js b/apps/files/js/templates.js index be6b255d594..7dd14ac67e8 100644 --- a/apps/files/js/templates.js +++ b/apps/files/js/templates.js @@ -92,32 +92,38 @@ templates['file_action_trigger'] = template({"1":function(container,depth0,helpe templates['fileactionsmenu'] = 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; - return " <li>\n <a href=\"#\" class=\"menuitem action action-" + return " <li class=\"" + + ((stack1 = helpers["if"].call(alias1,(depth0 != null ? depth0.inline : depth0),{"name":"if","hash":{},"fn":container.program(2, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "") + + " action-" + + alias4(((helper = (helper = helpers.nameLowerCase || (depth0 != null ? depth0.nameLowerCase : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"nameLowerCase","hash":{},"data":data}) : helper))) + + "-container\">\n <a href=\"#\" class=\"menuitem action action-" + alias4(((helper = (helper = helpers.nameLowerCase || (depth0 != null ? depth0.nameLowerCase : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"nameLowerCase","hash":{},"data":data}) : helper))) + " permanent\" data-action=\"" + alias4(((helper = (helper = helpers.name || (depth0 != null ? depth0.name : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"name","hash":{},"data":data}) : helper))) + "\">\n " - + ((stack1 = helpers["if"].call(alias1,(depth0 != null ? depth0.icon : depth0),{"name":"if","hash":{},"fn":container.program(2, data, 0),"inverse":container.program(4, data, 0),"data":data})) != null ? stack1 : "") + + ((stack1 = helpers["if"].call(alias1,(depth0 != null ? depth0.icon : depth0),{"name":"if","hash":{},"fn":container.program(4, data, 0),"inverse":container.program(6, data, 0),"data":data})) != null ? stack1 : "") + " <span>" + alias4(((helper = (helper = helpers.displayName || (depth0 != null ? depth0.displayName : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"displayName","hash":{},"data":data}) : helper))) + "</span>\n </a>\n </li>\n"; },"2":function(container,depth0,helpers,partials,data) { + return "hidden"; +},"4":function(container,depth0,helpers,partials,data) { var helper; return "<img class=\"icon\" src=\"" + container.escapeExpression(((helper = (helper = helpers.icon || (depth0 != null ? depth0.icon : depth0)) != null ? helper : helpers.helperMissing),(typeof helper === "function" ? helper.call(depth0 != null ? depth0 : (container.nullContext || {}),{"name":"icon","hash":{},"data":data}) : helper))) + "\"/>\n"; -},"4":function(container,depth0,helpers,partials,data) { +},"6":function(container,depth0,helpers,partials,data) { var stack1; - return ((stack1 = helpers["if"].call(depth0 != null ? depth0 : (container.nullContext || {}),(depth0 != null ? depth0.iconClass : depth0),{"name":"if","hash":{},"fn":container.program(5, data, 0),"inverse":container.program(7, data, 0),"data":data})) != null ? stack1 : ""); -},"5":function(container,depth0,helpers,partials,data) { + return ((stack1 = helpers["if"].call(depth0 != null ? depth0 : (container.nullContext || {}),(depth0 != null ? depth0.iconClass : depth0),{"name":"if","hash":{},"fn":container.program(7, data, 0),"inverse":container.program(9, data, 0),"data":data})) != null ? stack1 : ""); +},"7":function(container,depth0,helpers,partials,data) { var helper; return " <span class=\"icon " + container.escapeExpression(((helper = (helper = helpers.iconClass || (depth0 != null ? depth0.iconClass : depth0)) != null ? helper : helpers.helperMissing),(typeof helper === "function" ? helper.call(depth0 != null ? depth0 : (container.nullContext || {}),{"name":"iconClass","hash":{},"data":data}) : helper))) + "\"></span>\n"; -},"7":function(container,depth0,helpers,partials,data) { +},"9":function(container,depth0,helpers,partials,data) { return " <span class=\"no-icon\"></span>\n"; },"compiler":[7,">= 4.0.0"],"main":function(container,depth0,helpers,partials,data) { var stack1; diff --git a/apps/files/js/templates/fileactionsmenu.handlebars b/apps/files/js/templates/fileactionsmenu.handlebars index d8d1b78fd86..b14ec02e5b9 100644 --- a/apps/files/js/templates/fileactionsmenu.handlebars +++ b/apps/files/js/templates/fileactionsmenu.handlebars @@ -1,6 +1,6 @@ <ul> {{#each items}} - <li> + <li class="{{#if inline}}hidden{{/if}} action-{{nameLowerCase}}-container"> <a href="#" class="menuitem action action-{{nameLowerCase}} permanent" data-action="{{name}}"> {{#if icon}}<img class="icon" src="{{icon}}"/> {{else}} |