Fix new task order + fix notes order.

This commit is contained in:
John Livingston
2024-07-30 16:04:12 +02:00
parent fbc9a39485
commit 1c749f68bc
4 changed files with 14 additions and 5 deletions

View File

@ -107,9 +107,11 @@ export default class MUCNotesView extends DraggablesCustomElement {
}
let newOrder = targetNote.get('order') ?? 0
if (!onTopHalf) { newOrder = Math.max(0, newOrder + 1) }
if (onTopHalf) { newOrder = Math.max(0, newOrder + 1) } // reverse order!
this._saveOrders(this.model, note, newOrder)
// Warning: the order of the collection is reversed!
// _saveOrders needs it in ascending order!
this._saveOrders(Array.from(this.model).reverse(), note, newOrder)
}
}