aboutsummaryrefslogtreecommitdiffstats
path: root/apps/files/js/fileactionsmenu.js
diff options
context:
space:
mode:
authorThomas Müller <thomas.mueller@tmit.eu>2015-09-28 12:53:11 +0200
committerThomas Müller <thomas.mueller@tmit.eu>2015-09-28 12:53:11 +0200
commit716ff81b27658580dcbe306e6cbe2c0cad8b1411 (patch)
tree9c93cb28b008cea2b90d8e3f9ab3da178b8121ae /apps/files/js/fileactionsmenu.js
parent0bf2bb07517a6fbe17a8a1fd62225181ec39798c (diff)
parentf35b6833ff2f702db75999bfd9343e7bc2fc7f2c (diff)
downloadnextcloud-server-716ff81b27658580dcbe306e6cbe2c0cad8b1411.tar.gz
nextcloud-server-716ff81b27658580dcbe306e6cbe2c0cad8b1411.zip
Merge pull request #19401 from owncloud/files-actionsorder
Fix order of actions in the files actions menu
Diffstat (limited to 'apps/files/js/fileactionsmenu.js')
-rw-r--r--apps/files/js/fileactionsmenu.js8
1 files changed, 8 insertions, 0 deletions
diff --git a/apps/files/js/fileactionsmenu.js b/apps/files/js/fileactionsmenu.js
index 5ab0e42f93e..67cbb48c965 100644
--- a/apps/files/js/fileactionsmenu.js
+++ b/apps/files/js/fileactionsmenu.js
@@ -100,6 +100,14 @@
(!defaultAction || actionSpec.name !== defaultAction.name)
);
});
+ items = items.sort(function(actionA, actionB) {
+ var orderA = actionA.order || 0;
+ var orderB = actionB.order || 0;
+ if (orderB === orderA) {
+ return OC.Util.naturalSortCompare(actionA.displayName, actionB.displayName);
+ }
+ return orderA - orderB;
+ });
items = _.map(items, function(item) {
item.nameLowerCase = item.name.toLowerCase();
return item;