* [bug #57792] fix doc sorting UI.
This commit is contained in:
@@ -2007,7 +2007,7 @@ function isMatchFilter(type, filterType, item)
|
||||
*/
|
||||
function formatOrders(orders, useIndex)
|
||||
{
|
||||
const orderedKeys = useIndex ? [] : Array.from(orders).sort();
|
||||
const orderedKeys = useIndex ? [] : Array.from(orders).sort((a, b) => a - b);
|
||||
return orders.reduce((map, key, index) =>
|
||||
{
|
||||
map[key] = useIndex ? index : orderedKeys[index];
|
||||
@@ -2078,6 +2078,13 @@ function getSortableOptions(type)
|
||||
if(fromType !== 'doc') key = key.substring(1);
|
||||
orderedList.push(+key);
|
||||
});
|
||||
if(fromType === 'doc')
|
||||
{
|
||||
const docApp = getDocApp();
|
||||
const doc = docApp.getDoc(orderedList[0]);
|
||||
const lib = doc ? docApp.getLib(doc.lib) : null;
|
||||
if(lib && typeof lib.data.orderBy === 'string' && lib.data.orderBy.endsWith('desc')) orderedList.reverse();
|
||||
}
|
||||
sortItems(fromType, orderedList);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user