From 112cc727ea3f026f5ec7c19120fe6eb87d90f732 Mon Sep 17 00:00:00 2001 From: anoy Date: Mon, 9 Nov 2020 11:41:34 +0100 Subject: add locale-aware sorting for folders and feeds Signed-off-by: anoy --- js/controller/NavigationController.js | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'js') diff --git a/js/controller/NavigationController.js b/js/controller/NavigationController.js index 7467acffa..1b183cbdf 100644 --- a/js/controller/NavigationController.js +++ b/js/controller/NavigationController.js @@ -406,4 +406,11 @@ app.controller('NavigationController', function ($route, FEED_TYPE, FeedResource setSelectedFolderForRoute(); }); + $rootScope.localeComparator = function(v1, v2) { + if (v1.type === 'string' && v2.type === 'string') { + return v1.value.localeCompare(v2.value); + } + + return (v1.value === v2.value) ? 0 : ((v1.value < v2.value) ? -1 : 1); + }; }); -- cgit v1.2.3