Commit 6c3caa00 authored by Phil Hughes's avatar Phil Hughes

Fixed error when trying to drag list several times

parent 11497095
...@@ -36,7 +36,6 @@ ...@@ -36,7 +36,6 @@
}, },
ready: function () { ready: function () {
const options = _.extend({ const options = _.extend({
// sort: false,
group: 'issues', group: 'issues',
disabled: this.disabled, disabled: this.disabled,
onAdd: function (e) { onAdd: function (e) {
......
...@@ -79,7 +79,9 @@ ...@@ -79,7 +79,9 @@
listTo = this.findList('position', newIndex); listTo = this.findList('position', newIndex);
listFrom.position = newIndex; listFrom.position = newIndex;
if (newIndex > listTo.position) { if (newIndex === listTo.position) {
listTo.position = oldIndex;
} else if (newIndex > listTo.position) {
listTo.position--; listTo.position--;
} else { } else {
listTo.position++; listTo.position++;
...@@ -97,8 +99,6 @@ ...@@ -97,8 +99,6 @@
return issue.label; return issue.label;
}); });
listFrom.removeIssue(issue);
// Add to new lists issues if it doesn't already exist // Add to new lists issues if it doesn't already exist
if (!issueTo) { if (!issueTo) {
listTo.addIssue(issue, listFrom); listTo.addIssue(issue, listFrom);
...@@ -109,6 +109,8 @@ ...@@ -109,6 +109,8 @@
list.removeIssue(issue); list.removeIssue(issue);
}); });
issue.removeLabels(listLabels); issue.removeLabels(listLabels);
} else {
listFrom.removeIssue(issue);
} }
}, },
findList: function (key, val) { findList: function (key, val) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment