Merge pull request #5310 from tsiegleauq/better-category-sorting
Sort motions in categories by inner weight (again)
This commit is contained in:
commit
a7518ed5b6
@ -98,10 +98,10 @@ export class MotionSortListService extends BaseSortListService<ViewMotion> {
|
||||
* @returns {number} The result of comparing.
|
||||
*/
|
||||
private categorySortFn(itemA: ViewMotion, itemB: ViewMotion, ascending: boolean): number {
|
||||
if (itemA.category.weight < itemB.category.weight === ascending) {
|
||||
return -1;
|
||||
if (itemA.category_id === itemB.category_id) {
|
||||
return itemA.category_weight < itemB.category_weight === ascending ? -1 : 1;
|
||||
} else {
|
||||
return 1;
|
||||
return itemA.category.weight < itemB.category.weight === ascending ? -1 : 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user