Remove unused KnockoutJS afterMove

This commit is contained in:
djmaze 2021-09-27 12:49:40 +02:00
parent 130397dd89
commit 244d4c49c5
4 changed files with 66 additions and 82 deletions

View file

@ -60,7 +60,6 @@
var nodesToDelete = [];
var itemsToMoveFirstIndexes = [];
var itemsForBeforeRemoveCallbacks = [];
var itemsForAfterMoveCallbacks = [];
var mapData;
var countWaitingForRemove = 0;
@ -71,9 +70,6 @@
function itemMovedOrRetained(oldPosition) {
mapData = lastMappingResult[oldPosition];
if (currentArrayIndex !== mapData.indexObservable.peek()) {
itemsForAfterMoveCallbacks[currentArrayIndex] = mapData;
}
// Since updating the index might change the nodes, do so before calling fixUpContinuousNodeArray
mapData.indexObservable(currentArrayIndex++);
ko.utils.fixUpContinuousNodeArray(mapData.mappedNodes, domNode);
@ -227,8 +223,5 @@
itemsForBeforeRemoveCallbacks[i].arrayEntry = deletedItemDummyValue;
}
}
// Finally call afterMove and afterAdd callbacks
callCallback(options['afterMove'], itemsForAfterMoveCallbacks);
}
})();