src/common/js/winjs/js/ui.js
function updateIndicies(modifiedElements, cachedRecords) {
                        var updatedCachedRecords = {};

                        for (var i = 0, len = modifiedElements.length; i < len; i++) {
                            var modifiedElementLookup = modifiedElements[i];
                            var cachedRecord = cachedRecords[modifiedElementLookup.oldIndex];
                            if (cachedRecord) {
                                updatedCachedRecords[modifiedElementLookup.newIndex] = cachedRecord;
                                cachedRecord.element = modifiedElementLookup.element;
                                delete cachedRecords[modifiedElementLookup.oldIndex];
                            }
                        }
                        var cachedRecordKeys = Object.keys(cachedRecords);
                        for (var i = 0, len = cachedRecordKeys.length; i < len; i++) {
                            var key = cachedRecordKeys[i],
                                record = cachedRecords[key];
                            // We need to filter out containers which were removed from the DOM. If container's item
                            // wasn't realized container can be removed without adding record to modifiedItems.
                            if (!record.element || existingContainers[uniqueID(record.element)]) {
                                updatedCachedRecords[key] = record;
                            }
                        }
                        return updatedCachedRecords;
                    }
function updateIndicies(modifiedElements, cachedRecords) {
                        var updatedCachedRecords = {};

                        for (var i = 0, len = modifiedElements.length; i < len; i++) {
                            var modifiedElementLookup = modifiedElements[i];
                            var cachedRecord = cachedRecords[modifiedElementLookup.oldIndex];
                            if (cachedRecord) {
                                updatedCachedRecords[modifiedElementLookup.newIndex] = cachedRecord;
                                cachedRecord.element = modifiedElementLookup.element;
                                delete cachedRecords[modifiedElementLookup.oldIndex];
                            }
                        }
                        var cachedRecordKeys = Object.keys(cachedRecords);
                        for (var i = 0, len = cachedRecordKeys.length; i < len; i++) {
                            var key = cachedRecordKeys[i],
                                record = cachedRecords[key];
                            // We need to filter out containers which were removed from the DOM. If container's item
                            // wasn't realized container can be removed without adding record to modifiedItems.
                            if (!record.element || existingContainers[uniqueID(record.element)]) {
                                updatedCachedRecords[key] = record;
                            }
                        }
                        return updatedCachedRecords;
                    }
function updateIndicies ( modifiedElements , cachedRecords ) { var updatedCachedRecords = { } ; for ( var i = 0 , len = modifiedElements . length ; i < len ; i ++ ) { var modifiedElementLookup = modifiedElements [ i ] ; var cachedRecord = cachedRecords [ modifiedElementLookup . oldIndex ] ; if ( cachedRecord ) { updatedCachedRecords [ modifiedElementLookup . newIndex ] = cachedRecord ; cachedRecord . element = modifiedElementLookup . element ; delete cachedRecords [ modifiedElementLookup . oldIndex ] ; } } var cachedRecordKeys = Object . keys ( cachedRecords ) ; for ( var i = 0 , len = cachedRecordKeys . length ; i < len ; i ++ ) { var key = cachedRecordKeys [ i ] , record = cachedRecords [ key ] ; // We need to filter out containers which were removed from the DOM. If container's item // wasn't realized container can be removed without adding record to modifiedItems. if ( ! record . element || existingContainers [ uniqueID ( record . element ) ] ) { updatedCachedRecords [ key ] = record ; } } return updatedCachedRecords ; }
Update the indicies before the insert since insert needs the new containers.
Update the indicies before the insert since insert needs the new containers .