Fix regression introduced in 4e7fa2f04e

This commit is contained in:
Jürg Lehni 2016-02-14 21:55:26 +01:00
parent 4e7fa2f04e
commit 55e7689186

View file

@ -2329,11 +2329,11 @@ new function() { // Injection scope for hit-test functions shared with project
} else { } else {
// If the item is removed and inserted it again further // If the item is removed and inserted it again further
/// above, the index needs to be adjusted accordingly. /// above, the index needs to be adjusted accordingly.
var parent = item._parent, var owner = item._getOwner(),
shift = parent === this && item._index < index; shift = owner === this && item._index < index;
// Notify parent of change. Don't notify item itself yet, // Notify parent of change. Don't notify item itself yet,
// as we're doing so when adding it to the new parent below. // as we're doing so when adding it to the new owner below.
if (parent && item._remove(false, true) && shift) if (owner && item._remove(false, true) && shift)
index--; index--;
} }
} }