sforkowany z mirror/friendica
Merge pull request #7959 from MrPetovan/bug/7902-acl-fixes
Add meaningful sorter to ACL autocomplete2022.09-rc
commit
50f5e4e7ed
|
@ -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();
|
||||
|
||||
|
|
Ładowanie…
Reference in New Issue