From afe4c5c8478fe271a643708d80c73361373b1b14 Mon Sep 17 00:00:00 2001 From: Shyam Sunder Date: Fri, 25 Sep 2020 00:02:12 -0400 Subject: [PATCH] client/tag-categories: sort by order on tag-category edit page --- client/js/views/tag_categories_view.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/client/js/views/tag_categories_view.js b/client/js/views/tag_categories_view.js index 7cd5c19e..e052fd4d 100644 --- a/client/js/views/tag_categories_view.js +++ b/client/js/views/tag_categories_view.js @@ -24,7 +24,9 @@ class TagCategoriesView extends events.EventTarget { } else if (a.isDefault) { return -1; } - return a.name.localeCompare(b.name); + return a.order == b.order + ? a.name.localeCompare(b.name) + : a.order - b.order; }); for (let tagCategory of categoriesToAdd) { this._addTagCategoryRowNode(tagCategory);