mirror of
https://github.com/wekan/wekan.git
synced 2026-02-27 18:34:07 +01:00
List add always at the end of all lists
- if a sort number is higher than the count of lists, the list wasn't added at the end
This commit is contained in:
parent
fa9641ba7b
commit
0fb6b6e519
2 changed files with 12 additions and 1 deletions
|
|
@ -237,13 +237,15 @@ BlazeComponent.extendComponent({
|
|||
{
|
||||
submit(evt) {
|
||||
evt.preventDefault();
|
||||
const lastList = this.currentBoard.getLastList();
|
||||
const sortIndex = Utils.calculateIndexData(lastList, null).base;
|
||||
const titleInput = this.find('.list-name-input');
|
||||
const title = titleInput.value.trim();
|
||||
if (title) {
|
||||
Lists.insert({
|
||||
title,
|
||||
boardId: Session.get('currentBoard'),
|
||||
sort: $('.js-list').length,
|
||||
sort: sortIndex,
|
||||
type: this.isListTemplatesSwimlane ? 'template-list' : 'list',
|
||||
swimlaneId: this.currentBoard.isTemplatesBoard()
|
||||
? this.currentSwimlane._id
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue