From: Hypolite Petovan Date: Mon, 16 Dec 2019 08:13:32 +0000 (-0500) Subject: Add meaningful sorter to ACL autocomplete X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=2d3c0520c34031cd4e9b0360cd68e3d5657fac53;p=friendica.git Add meaningful sorter to ACL autocomplete --- diff --git a/view/templates/acl_selector.tpl b/view/templates/acl_selector.tpl index a5929900b3..a9da4f6118 100644 --- a/view/templates/acl_selector.tpl +++ b/view/templates/acl_selector.tpl @@ -145,6 +145,15 @@ identify: function(obj) { return obj.type + '-' + obj.id.toString(); }, datumTokenizer: Bloodhound.tokenizers.obj.whitespace(['name', 'addr']), queryTokenizer: Bloodhound.tokenizers.whitespace, + sorter: function (itemA, itemB) { + if (itemA.name === itemB.name) { + return 0; + } else if (itemA.name > itemB.name) { + return 1; + } else { + return -1; + } + }, }); acl.initialize();