From f35b6833ff2f702db75999bfd9343e7bc2fc7f2c Mon Sep 17 00:00:00 2001 From: Vincent Petry Date: Mon, 28 Sep 2015 11:19:49 +0200 Subject: Fix order of actions in the files actions menu --- apps/files/js/fileactionsmenu.js | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'apps/files/js/fileactionsmenu.js') 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; -- cgit v1.2.3