summaryrefslogtreecommitdiff
path: root/app/assets/javascripts/boards/models
diff options
context:
space:
mode:
authorPhil Hughes <me@iamphill.com>2016-11-24 10:32:55 +0000
committerPhil Hughes <me@iamphill.com>2016-11-24 10:32:55 +0000
commit058c652904b13cea73e92615776f29fd1a8a1ded (patch)
treef839fc4ca3c7773d8541ba02dff77f3467f85455 /app/assets/javascripts/boards/models
parent00162d24d909a127656eae9393b01b36c23d4254 (diff)
downloadgitlab-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.es68
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);