mirror of
https://github.com/zulip/zulip.git
synced 2025-11-19 05:58:25 +00:00
list_render: Convert sorting_functions from object to Map.
Signed-off-by: Anders Kaseorg <anders@zulipchat.com>
This commit is contained in:
committed by
Tim Abbott
parent
e5c577aad4
commit
4f39199f6d
@@ -45,7 +45,7 @@ exports.create = function ($container, list, opts) {
|
||||
const meta = {
|
||||
sorting_function: null,
|
||||
prop: null,
|
||||
sorting_functions: {},
|
||||
sorting_functions: new Map(),
|
||||
generic_sorting_functions: {},
|
||||
offset: 0,
|
||||
listRenders: {},
|
||||
@@ -225,7 +225,7 @@ exports.create = function ($container, list, opts) {
|
||||
/* eslint-disable max-len */
|
||||
meta.sorting_function = meta.generic_sorting_functions[sorting_function](prop);
|
||||
} else {
|
||||
meta.sorting_function = meta.sorting_functions[sorting_function];
|
||||
meta.sorting_function = meta.sorting_functions.get(sorting_function);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -247,7 +247,7 @@ exports.create = function ($container, list, opts) {
|
||||
},
|
||||
|
||||
add_sort_function: function (name, sorting_function) {
|
||||
meta.sorting_functions[name] = sorting_function;
|
||||
meta.sorting_functions.set(name, sorting_function);
|
||||
},
|
||||
|
||||
// generic sorting functions are ones that will use a specified prop
|
||||
|
||||
Reference in New Issue
Block a user