diff options
author | Phil Hughes <me@iamphill.com> | 2016-11-24 10:32:55 +0000 |
---|---|---|
committer | Phil Hughes <me@iamphill.com> | 2016-11-24 10:32:55 +0000 |
commit | 058c652904b13cea73e92615776f29fd1a8a1ded (patch) | |
tree | f839fc4ca3c7773d8541ba02dff77f3467f85455 /app/assets/javascripts/boards/models | |
parent | 00162d24d909a127656eae9393b01b36c23d4254 (diff) | |
download | gitlab-ce-058c652904b13cea73e92615776f29fd1a8a1ded.tar.gz |
Fixed issue boards issue sorting when dragging issue into list
Currently it just appends the new issue to the end of list & then sorts by priority which can cause some strange effects. For example if you drag the issue to the top of the list & then vue re-renders, the issue actually goes to the bottom.
Diffstat (limited to 'app/assets/javascripts/boards/models')
-rw-r--r-- | app/assets/javascripts/boards/models/list.js.es6 | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/app/assets/javascripts/boards/models/list.js.es6 b/app/assets/javascripts/boards/models/list.js.es6 index 8a7dc67409e..429bd27c3fb 100644 --- a/app/assets/javascripts/boards/models/list.js.es6 +++ b/app/assets/javascripts/boards/models/list.js.es6 @@ -106,9 +106,13 @@ class List { }); } - addIssue (issue, listFrom) { + addIssue (issue, listFrom, newIndex) { if (!this.findIssue(issue.id)) { - this.issues.push(issue); + if (newIndex !== undefined) { + this.issues.splice(newIndex, 0, issue); + } else { + this.issues.push(issue); + } if (this.label) { issue.addLabel(this.label); |