src/common/js/winjs/js/ui.js
function _LayoutCommon_viewportSizeChanged(viewportContentSize) {
                    var sizes = this._sizes;

                    sizes.viewportContentSize = viewportContentSize;
                    sizes.surfaceContentSize = viewportContentSize - sizes.surfaceOuterCrossSize;
                    sizes.maxItemsContainerContentSize = sizes.surfaceContentSize - sizes.itemsContainerOuterCrossSize - this._getHeaderSizeContentAdjustment();

                    // This calculation is for uniform layouts
                    if (sizes.containerSizeLoaded && !this._inListMode) {
                        this._itemsPerBar = Math.floor(sizes.maxItemsContainerContentSize / sizes.containerCrossSize);
                        if (this.maximumRowsOrColumns) {
                            this._itemsPerBar = Math.min(this._itemsPerBar, this.maximumRowsOrColumns);
                        }
                        this._itemsPerBar = Math.max(1, this._itemsPerBar);
                    } else {
                        if (this._inListMode) {
                            sizes[this._horizontal ? "containerHeight" : "containerWidth"] = sizes.maxItemsContainerContentSize;
                        }
                        this._itemsPerBar = 1;
                    }

                    // Ignore animations if height changed
                    this._resetAnimationCaches();
                }
function _LayoutCommon_viewportSizeChanged(viewportContentSize) {
                    var sizes = this._sizes;

                    sizes.viewportContentSize = viewportContentSize;
                    sizes.surfaceContentSize = viewportContentSize - sizes.surfaceOuterCrossSize;
                    sizes.maxItemsContainerContentSize = sizes.surfaceContentSize - sizes.itemsContainerOuterCrossSize - this._getHeaderSizeContentAdjustment();

                    // This calculation is for uniform layouts
                    if (sizes.containerSizeLoaded && !this._inListMode) {
                        this._itemsPerBar = Math.floor(sizes.maxItemsContainerContentSize / sizes.containerCrossSize);
                        if (this.maximumRowsOrColumns) {
                            this._itemsPerBar = Math.min(this._itemsPerBar, this.maximumRowsOrColumns);
                        }
                        this._itemsPerBar = Math.max(1, this._itemsPerBar);
                    } else {
                        if (this._inListMode) {
                            sizes[this._horizontal ? "containerHeight" : "containerWidth"] = sizes.maxItemsContainerContentSize;
                        }
                        this._itemsPerBar = 1;
                    }

                    // Ignore animations if height changed
                    this._resetAnimationCaches();
                }
function _LayoutCommon_viewportSizeChanged ( viewportContentSize ) { var sizes = this . _sizes ; sizes . viewportContentSize = viewportContentSize ; sizes . surfaceContentSize = viewportContentSize - sizes . surfaceOuterCrossSize ; sizes . maxItemsContainerContentSize = sizes . surfaceContentSize - sizes . itemsContainerOuterCrossSize - this . _getHeaderSizeContentAdjustment ( ) ; // This calculation is for uniform layouts if ( sizes . containerSizeLoaded && ! this . _inListMode ) { this . _itemsPerBar = Math . floor ( sizes . maxItemsContainerContentSize / sizes . containerCrossSize ) ; if ( this . maximumRowsOrColumns ) { this . _itemsPerBar = Math . min ( this . _itemsPerBar , this . maximumRowsOrColumns ) ; } this . _itemsPerBar = Math . max ( 1 , this . _itemsPerBar ) ; } else { if ( this . _inListMode ) { sizes [ this . _horizontal ? "containerHeight" : "containerWidth" ] = sizes . maxItemsContainerContentSize ; } this . _itemsPerBar = 1 ; } // Ignore animations if height changed this . _resetAnimationCaches ( ) ; }
viewportContentSize is the new viewport size
viewportContentSize is the new viewport size