fix #984: wrong group placement when moving groups inside one subgroups below itself

This commit is contained in:
antelle 2018-08-23 22:13:02 +02:00
parent d95ccdf01a
commit 797bc4820b
1 changed files with 5 additions and 1 deletions

View File

@ -313,7 +313,11 @@ const GroupModel = MenuItemModel.extend({
return;
}
}
const atIndex = this.parentGroup.group.groups.indexOf(this.group);
let atIndex = this.parentGroup.group.groups.indexOf(this.group);
const selfIndex = this.parentGroup.group.groups.indexOf(object.group);
if (selfIndex < atIndex) {
atIndex--;
}
if (atIndex >= 0) {
this.file.db.move(object.group, this.parentGroup.group, atIndex);
}