mirror of
https://github.com/zulip/zulip.git
synced 2025-11-19 22:19:48 +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 = {
|
const meta = {
|
||||||
sorting_function: null,
|
sorting_function: null,
|
||||||
prop: null,
|
prop: null,
|
||||||
sorting_functions: {},
|
sorting_functions: new Map(),
|
||||||
generic_sorting_functions: {},
|
generic_sorting_functions: {},
|
||||||
offset: 0,
|
offset: 0,
|
||||||
listRenders: {},
|
listRenders: {},
|
||||||
@@ -225,7 +225,7 @@ exports.create = function ($container, list, opts) {
|
|||||||
/* eslint-disable max-len */
|
/* eslint-disable max-len */
|
||||||
meta.sorting_function = meta.generic_sorting_functions[sorting_function](prop);
|
meta.sorting_function = meta.generic_sorting_functions[sorting_function](prop);
|
||||||
} else {
|
} 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) {
|
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
|
// generic sorting functions are ones that will use a specified prop
|
||||||
|
|||||||
Reference in New Issue
Block a user