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 @@
},
ready: function () {
const options = _.extend({
// sort: false,
group: 'issues',
disabled: this.disabled,
onAdd: function (e) {
......
......@@ -79,7 +79,9 @@
listTo = this.findList('position', newIndex);
listFrom.position = newIndex;
if (newIndex > listTo.position) {
if (newIndex === listTo.position) {
listTo.position = oldIndex;
} else if (newIndex > listTo.position) {
listTo.position--;
} else {
listTo.position++;
......@@ -97,8 +99,6 @@
return issue.label;
});
listFrom.removeIssue(issue);
// Add to new lists issues if it doesn't already exist
if (!issueTo) {
listTo.addIssue(issue, listFrom);
......@@ -109,6 +109,8 @@
list.removeIssue(issue);
});
issue.removeLabels(listLabels);
} else {
listFrom.removeIssue(issue);
}
},
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