src/common/js/winjs/js/ui.js
function layoutUnrealizedRange() {
                        if (that._groups.length === 0) {
                            return Promise.wrap();
                        }

                        var realizedItemRange = that._getRealizationRange(),
                            // Last group before the realized range which contains 1 or more unrealized items
                            lastGroupBefore = site.groupIndexFromItemIndex(realizedItemRange.firstIndex - 1),
                            // First group after the realized range which contains 1 or more unrealized items
                            firstGroupAfter = site.groupIndexFromItemIndex(realizedItemRange.lastIndex + 1),
                            firstChangedGroup = site.groupIndexFromItemIndex(changedRange.firstIndex),
                            layoutPromises = [],
                            groupCount = that._groups.length;

                        var stop = false;
                        var before = lastGroupBefore;
                        var after = Math.max(firstChangedGroup, firstGroupAfter);
                        after = Math.max(before + 1, after);
                        while (!stop) {
                            stop = true;
                            if (before >= firstChangedGroup) {
                                layoutPromises.push(layoutGroupContent(before, realizedItemRange, false));
                                stop = false;
                                before--;
                            }
                            if (after < groupCount) {
                                layoutPromises.push(layoutGroupContent(after, realizedItemRange, false));
                                stop = false;
                                after++;
                            }
                        }

                        return Promise.join(layoutPromises);
                    }
function layoutUnrealizedRange() {
                        if (that._groups.length === 0) {
                            return Promise.wrap();
                        }

                        var realizedItemRange = that._getRealizationRange(),
                            // Last group before the realized range which contains 1 or more unrealized items
                            lastGroupBefore = site.groupIndexFromItemIndex(realizedItemRange.firstIndex - 1),
                            // First group after the realized range which contains 1 or more unrealized items
                            firstGroupAfter = site.groupIndexFromItemIndex(realizedItemRange.lastIndex + 1),
                            firstChangedGroup = site.groupIndexFromItemIndex(changedRange.firstIndex),
                            layoutPromises = [],
                            groupCount = that._groups.length;

                        var stop = false;
                        var before = lastGroupBefore;
                        var after = Math.max(firstChangedGroup, firstGroupAfter);
                        after = Math.max(before + 1, after);
                        while (!stop) {
                            stop = true;
                            if (before >= firstChangedGroup) {
                                layoutPromises.push(layoutGroupContent(before, realizedItemRange, false));
                                stop = false;
                                before--;
                            }
                            if (after < groupCount) {
                                layoutPromises.push(layoutGroupContent(after, realizedItemRange, false));
                                stop = false;
                                after++;
                            }
                        }

                        return Promise.join(layoutPromises);
                    }
function layoutUnrealizedRange ( ) { if ( that . _groups . length === 0 ) { return Promise . wrap ( ) ; } var realizedItemRange = that . _getRealizationRange ( ) , // Last group before the realized range which contains 1 or more unrealized items lastGroupBefore = site . groupIndexFromItemIndex ( realizedItemRange . firstIndex - 1 ) , // First group after the realized range which contains 1 or more unrealized items firstGroupAfter = site . groupIndexFromItemIndex ( realizedItemRange . lastIndex + 1 ) , firstChangedGroup = site . groupIndexFromItemIndex ( changedRange . firstIndex ) , layoutPromises = [ ] , groupCount = that . _groups . length ; var stop = false ; var before = lastGroupBefore ; var after = Math . max ( firstChangedGroup , firstGroupAfter ) ; after = Math . max ( before + 1 , after ) ; while ( ! stop ) { stop = true ; if ( before >= firstChangedGroup ) { layoutPromises . push ( layoutGroupContent ( before , realizedItemRange , false ) ) ; stop = false ; before -- ; } if ( after < groupCount ) { layoutPromises . push ( layoutGroupContent ( after , realizedItemRange , false ) ) ; stop = false ; after ++ ; } } return Promise . join ( layoutPromises ) ; }
Asynchronously lays out the unrealized items
Asynchronously lays out the unrealized items