diff options
author | Vincent Petry <pvince81@owncloud.com> | 2015-09-28 11:19:49 +0200 |
---|---|---|
committer | Vincent Petry <pvince81@owncloud.com> | 2015-09-28 11:19:49 +0200 |
commit | f35b6833ff2f702db75999bfd9343e7bc2fc7f2c (patch) | |
tree | fd2ab1a1f958d4c8208abcbe57405d111de598d9 /apps/files/js/fileactionsmenu.js | |
parent | 9a010cc8ce281650038cd1444f63a02245eea523 (diff) | |
download | nextcloud-server-f35b6833ff2f702db75999bfd9343e7bc2fc7f2c.tar.gz nextcloud-server-f35b6833ff2f702db75999bfd9343e7bc2fc7f2c.zip |
Fix order of actions in the files actions menu
Diffstat (limited to 'apps/files/js/fileactionsmenu.js')
-rw-r--r-- | apps/files/js/fileactionsmenu.js | 8 |
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; |