Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(63)

Unified Diff: third_party/polymer/v1_0/components-chromium/app-layout/app-box/app-box-extracted.js

Issue 2633633002: Polymer: Remove unused app-layout element (Closed)
Patch Set: Fix closure Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/polymer/v1_0/components-chromium/app-layout/app-box/app-box-extracted.js
diff --git a/third_party/polymer/v1_0/components-chromium/app-layout/app-box/app-box-extracted.js b/third_party/polymer/v1_0/components-chromium/app-layout/app-box/app-box-extracted.js
deleted file mode 100644
index ae59bff78ba86fb121edf0195fabf1dc44651533..0000000000000000000000000000000000000000
--- a/third_party/polymer/v1_0/components-chromium/app-layout/app-box/app-box-extracted.js
+++ /dev/null
@@ -1,102 +0,0 @@
-Polymer({
- is: 'app-box',
-
- behaviors: [
- Polymer.AppScrollEffectsBehavior,
- Polymer.IronResizableBehavior
- ],
-
- listeners: {
- 'iron-resize': '_resizeHandler'
- },
-
- /**
- * The current scroll progress.
- *
- * @type {number}
- */
- _progress: 0,
-
- attached: function() {
- this.resetLayout();
- },
-
- /**
- * Resets the layout. This method is automatically called when the element is attached to the DOM.
- *
- * @method resetLayout
- */
- resetLayout: function() {
- this.debounce('_resetLayout', function() {
- // noop if the box isn't in the rendered tree
- if (this.offsetWidth === 0 && this.offsetHeight === 0) {
- return;
- }
-
- var scrollTop = this._clampedScrollTop;
- var savedDisabled = this.disabled;
-
- this.disabled = true;
- this._elementTop = this._getElementTop();
- this._elementHeight = this.offsetHeight;
- this._cachedScrollTargetHeight = this._scrollTargetHeight;
- this._setUpEffect();
- this._updateScrollState(scrollTop);
- this.disabled = savedDisabled;
- }, 1);
- },
-
- _getElementTop: function() {
- var currentNode = this;
- var top = 0;
-
- while (currentNode && currentNode !== this.scrollTarget) {
- top += currentNode.offsetTop;
- currentNode = currentNode.offsetParent;
- }
- return top;
- },
-
- _updateScrollState: function(scrollTop) {
- if (this.isOnScreen()) {
- var viewportTop = this._elementTop - scrollTop;
- this._progress = 1 - (viewportTop + this._elementHeight) / this._cachedScrollTargetHeight;
- this._runEffects(this._progress, scrollTop);
- }
- },
-
- /**
- * Returns true if this app-box is on the screen.
- * That is, visible in the current viewport.
- *
- * @method isOnScreen
- * @return {boolean}
- */
- isOnScreen: function() {
- return this._elementTop < this._scrollTop + this._cachedScrollTargetHeight
- && this._elementTop + this._elementHeight > this._scrollTop;
- },
-
- _resizeHandler: function() {
- this.resetLayout();
- },
-
- _getDOMRef: function(id) {
- if (id === 'background') {
- return this.$.background;
- }
- if (id === 'backgroundFrontLayer') {
- return this.$.backgroundFrontLayer;
- }
- },
-
- /**
- * Returns an object containing the progress value of the scroll effects.
- *
- * @method getScrollState
- * @return {Object}
- */
- getScrollState: function() {
- return { progress: this._progress };
- }
- });

Powered by Google App Engine
This is Rietveld 408576698