import animate from './animate'
import { requestAnimationFrame } from '../../polyfills/requestAnimationFrame'
import { getGeometry, getScrolled } from '../../utils/core'
import { each } from '../../utils/generic'
export default function delegate (event) {
var this$1 = this;
if ( event === void 0 ) event = {};
requestAnimationFrame(function () {
var containers = this$1.store.containers
var elements = this$1.store.elements
switch (event.type) {
case 'scroll':
each(containers, function (container) { return container.scroll = getScrolled.call(this$1, container); })
each(elements, function (element) { return animate.call(this$1, element); })
break
case 'resize':
default:
each(containers, function (container) {
container.geometry = getGeometry.call(this$1, container, /* isContainer: */ true)
container.scroll = getScrolled.call(this$1, container)
})
each(elements, function (element) {
element.geometry = getGeometry.call(this$1, element)
animate.call(this$1, element)
})
}
this$1.pristine = false
})
}
|