mirror of
https://github.com/zulip/zulip.git
synced 2025-11-06 23:13:25 +00:00
Fix sort error for streams with names that are numeric
The jQuery .data() documentation says: "Every attempt is made to convert the string to a JavaScript value (this includes booleans, numbers, objects, arrays, and null) otherwise it is left as a string. To retrieve the value's attribute as a string without any attempt to convert it, use the attr() method." (imported from commit f47c1cbb94cb5a98ea9842b00f45c35cd21873f9)
This commit is contained in:
@@ -907,7 +907,7 @@ function sort_narrow_list() {
|
||||
var items = $('#stream_filters li').get();
|
||||
var parent = $('#stream_filters');
|
||||
items.sort(function(a,b){
|
||||
return $(a).data('name').localeCompare($(b).data('name'));
|
||||
return $(a).attr('data-name').localeCompare($(b).attr('data-name'));
|
||||
});
|
||||
|
||||
parent.empty();
|
||||
|
||||
Reference in New Issue
Block a user