Fix: reduce HTTP POST generation on selections and drags (#26391) (#26552)

This commit is contained in:
Robert Monfera 2018-12-03 19:18:22 +01:00 committed by GitHub
parent b7bb154670
commit 629c5b67b7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -66,10 +66,16 @@ const elementToShape = (element, i) => {
};
};
const updateGlobalPositions = (setMultiplePositions, { shapes, gestureEnd }, elems) => {
const updateGlobalPositions = (setMultiplePositions, { shapes, gestureEnd }, unsortedElements) => {
const ascending = (a, b) => (a.id < b.id ? -1 : 1);
const relevant = s => s.type !== 'annotation' && s.subtype !== 'adHocGroup';
const elements = unsortedElements.filter(relevant).sort(ascending);
const repositionings = shapes
.filter(relevant)
.sort(ascending)
.map((shape, i) => {
const elemPos = elems[i] && elems[i].position;
const element = elements[i];
const elemPos = element && element.position;
if (elemPos && gestureEnd) {
// get existing position information from element
const oldProps = {