mirror of
https://github.com/zulip/zulip.git
synced 2025-11-02 21:13:36 +00:00
org settings: Make emoji list sortable.
This commit is contained in:
@@ -62,7 +62,7 @@ exports.populate_emoji = function (emoji_data) {
|
||||
}
|
||||
|
||||
var emoji_table = $('#admin_emoji_table').expectOne();
|
||||
list_render.create(emoji_table, Object.values(emoji_data), {
|
||||
var emoji_list = list_render.create(emoji_table, Object.values(emoji_data), {
|
||||
name: "emoji_list",
|
||||
modifier: function (item) {
|
||||
if (item.deactivated !== true) {
|
||||
@@ -90,6 +90,17 @@ exports.populate_emoji = function (emoji_data) {
|
||||
parent_container: $("#emoji-settings").expectOne(),
|
||||
}).init();
|
||||
|
||||
emoji_list.sort("alphabetic", "name");
|
||||
|
||||
emoji_list.add_sort_function("author_full_name", function (a, b) {
|
||||
if (a.author.full_name > b.author.full_name) {
|
||||
return 1;
|
||||
} else if (a.author.full_name === b.author.full_name) {
|
||||
return 0;
|
||||
}
|
||||
return -1;
|
||||
});
|
||||
|
||||
loading.destroy_indicator($('#admin_page_emoji_loading_indicator'));
|
||||
};
|
||||
|
||||
|
||||
@@ -31,9 +31,9 @@
|
||||
aria-label="{{t 'Filter linkifiers' }}"/>
|
||||
<table class="table table-condensed table-striped wrapped-table admin_emoji_table">
|
||||
<thead>
|
||||
<th>{{t "Name" }}</th>
|
||||
<th class="active" data-sort="alphabetic" data-sort-prop="name">{{t "Name" }}</th>
|
||||
<th class="image">{{t "Image" }}</th>
|
||||
<th class="image">{{t "Author" }}</th>
|
||||
<th class="image" data-sort="author_full_name">{{t "Author" }}</th>
|
||||
<th class="actions">{{t "Actions" }}</th>
|
||||
</thead>
|
||||
</table>
|
||||
|
||||
Reference in New Issue
Block a user