###* Application layout ================== This modules contains functions to scroll the viewport and reveal contained elements. @class up.layout ### up.layout = (($) -> u = up.util ###* Configures the application layout. @property up.layout.config @param {Array} [config.viewports] An array of CSS selectors that find viewports (containers that scroll their contents). @param {Array} [config.fixedTop] An array of CSS selectors that find elements fixed to the top edge of the screen (using `position: fixed`). @param {Array} [config.fixedBottom] An array of CSS selectors that find elements fixed to the bottom edge of the screen (using `position: fixed`). @param {Array} [config.anchoredRight] An array of CSS selectors that find elements anchored to the right edge of the screen (using `position: fixed` or `position: absolute`). @param {Number} [config.duration] The duration of the scrolling animation in milliseconds. Setting this to `0` will disable scrolling animations. @param {String} [config.easing] The timing function that controls the animation's acceleration. See [W3C documentation](http://www.w3.org/TR/css3-transitions/#transition-timing-function) for a list of pre-defined timing functions. @param {Number} [config.snap] When [revealing](/up.reveal) elements, Up.js will scroll an viewport to the top when the revealed element is closer to the top than `config.snap`. @param {Number} [config.substance] A number indicating how many top pixel rows of an element to [reveal](/up.reveal). @stable ### config = u.config duration: 0 viewports: [document, '.up-modal', '[up-viewport]'] fixedTop: ['[up-fixed~=top]'] fixedBottom: ['[up-fixed~=bottom]'] anchoredRight: ['[up-anchored~=right]', '[up-fixed~=top]', '[up-fixed~=bottom]', '[up-fixed~=right]'] snap: 50 substance: 150 easing: 'swing' lastScrollTops = u.cache size: 30, key: up.history.normalizeUrl reset = -> config.reset() lastScrollTops.clear() SCROLL_PROMISE_KEY = 'up-scroll-promise' ###* Scrolls the given viewport to the given Y-position. A "viewport" is an element that has scrollbars, e.g. `
` or a container with `overflow-x: scroll`. \#\#\#\# Example This will scroll a `Lorem ipsum dolor sit amet, consetetur sadipscing elitr. Stet clita kasd gubergren, no sea takimata sanctus est.