Fix "Move to Top" logic for creators
This commit is contained in:
parent
d7dc5670d5
commit
ae9c54b76d
1 changed files with 15 additions and 4 deletions
|
@ -2196,10 +2196,21 @@
|
||||||
newIndex = index + 1;
|
newIndex = index + 1;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
var a = this.item.getCreator(index);
|
let creator = this.item.getCreator(index);
|
||||||
var b = this.item.getCreator(newIndex);
|
// When moving to top, increment index of all other creators
|
||||||
this.item.setCreator(newIndex, a);
|
if (dir == 'top') {
|
||||||
this.item.setCreator(index, b);
|
let otherCreators = this.item.getCreators();
|
||||||
|
this.item.setCreator(newIndex, creator);
|
||||||
|
for (let i = 0; i < index; i++) {
|
||||||
|
this.item.setCreator(i + 1, otherCreators[i]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// When moving up or down, swap places with next creator
|
||||||
|
else {
|
||||||
|
let otherCreator = this.item.getCreator(newIndex);
|
||||||
|
this.item.setCreator(newIndex, creator);
|
||||||
|
this.item.setCreator(index, otherCreator);
|
||||||
|
}
|
||||||
if (this.saveOnEdit) {
|
if (this.saveOnEdit) {
|
||||||
// See note in transformText()
|
// See note in transformText()
|
||||||
yield this.blurOpenField();
|
yield this.blurOpenField();
|
||||||
|
|
Loading…
Reference in a new issue