normalizeDropTarget()

in public/src/js/models/group.js [68:89]


    normalizeDropTarget(targetGroup) {
        var isAfter, target;
        // Dragging above a Group is like dragging above the last item in that group
        // or if there aren't any other items, above those in the first preceding group that contains items.
        isAfter = false;

        target = _.last(targetGroup.items());
        if (target) {
            isAfter = true;
        } else if (targetGroup.parentType === 'Collection') {
            let groups = targetGroup.parent.groups;
            for (var i = groups.indexOf(targetGroup) - 1; i >= 0; i -= 1) {
                target = _.last(groups[i].items());
                if (target) {
                    isAfter = true;
                    break;
                }
            }
        }

        return {isAfter, target};
    }