| Index: third_party/polymer/v1_0/components-chromium/app-layout/app-scroll-effects/effects/parallax-background-extracted.js
|
| diff --git a/third_party/polymer/v1_0/components-chromium/app-layout/app-scroll-effects/effects/parallax-background-extracted.js b/third_party/polymer/v1_0/components-chromium/app-layout/app-scroll-effects/effects/parallax-background-extracted.js
|
| index 06ed13a3c419def68d77ee9bf1ff7c4d6806c44b..72bc02b8c39524707e48c03337a1da2187ab4364 100644
|
| --- a/third_party/polymer/v1_0/components-chromium/app-layout/app-scroll-effects/effects/parallax-background-extracted.js
|
| +++ b/third_party/polymer/v1_0/components-chromium/app-layout/app-scroll-effects/effects/parallax-background-extracted.js
|
| @@ -7,30 +7,35 @@
|
| * @this Polymer.AppLayout.ElementWithBackground
|
| */
|
| setUp: function setUp(config) {
|
| + var fx = {};
|
| var scalar = parseFloat(config.scalar);
|
| -
|
| - this._deltaBg = this.$.backgroundFrontLayer.offsetHeight - this.$.background.offsetHeight;
|
| - if (this._deltaBg === 0) {
|
| + fx.background = this._getDOMRef('background');
|
| + fx.backgroundFrontLayer = this._getDOMRef('backgroundFrontLayer');
|
| + fx.backgroundRearLayer = this._getDOMRef('backgroundRearLayer');
|
| + fx.deltaBg = fx.backgroundFrontLayer.offsetHeight - fx.background.offsetHeight;
|
| + if (fx.deltaBg === 0) {
|
| if (isNaN(scalar)) {
|
| scalar = 0.8;
|
| }
|
| - this._deltaBg = this._dHeight * scalar;
|
| + fx.deltaBg = this._dHeight * scalar;
|
| } else {
|
| if (isNaN(scalar)) {
|
| scalar = 1;
|
| }
|
| - this._deltaBg = this._deltaBg * scalar;
|
| + fx.deltaBg = fx.deltaBg * scalar;
|
| }
|
| - },
|
| - /** @this Polymer.AppLayout.ElementWithBackground */
|
| - tearDown: function tearDown() {
|
| - delete this._deltaBg;
|
| + this._fxParallaxBackground = fx;
|
| },
|
| /** @this Polymer.AppLayout.ElementWithBackground */
|
| run: function run(p, y) {
|
| - this.transform('translate3d(0px, ' + (this._deltaBg * Math.min(1, p)) + 'px, 0px)', this.$.backgroundFrontLayer);
|
| - if (this.$.backgroundRearLayer) {
|
| - this.transform('translate3d(0px, ' + (this._deltaBg * Math.min(1, p)) + 'px, 0px)', this.$.backgroundRearLayer);
|
| + var fx = this._fxParallaxBackground;
|
| + this.transform('translate3d(0px, ' + (fx.deltaBg * Math.min(1, p)) + 'px, 0px)', fx.backgroundFrontLayer);
|
| + if (fx.backgroundRearLayer) {
|
| + this.transform('translate3d(0px, ' + (fx.deltaBg * Math.min(1, p)) + 'px, 0px)', fx.backgroundRearLayer);
|
| }
|
| + },
|
| + /** @this Polymer.AppLayout.ElementWithBackground */
|
| + tearDown: function tearDown() {
|
| + delete this._fxParallaxBackground;
|
| }
|
| });
|
|
|