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

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

Issue 2074813002: Roll Polymer (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: chromium.patch Created 4 years, 6 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-header/app-header-extracted.js
diff --git a/third_party/polymer/v1_0/components-chromium/app-layout/app-header/app-header-extracted.js b/third_party/polymer/v1_0/components-chromium/app-layout/app-header/app-header-extracted.js
index 0774a1416c8e87863ee6c60202b36fc31a9cefab..20ca128e6c208552e720be791d7fc9a134a8f645 100644
--- a/third_party/polymer/v1_0/components-chromium/app-layout/app-header/app-header-extracted.js
+++ b/third_party/polymer/v1_0/components-chromium/app-layout/app-header/app-header-extracted.js
@@ -231,7 +231,7 @@ Polymer({
}
if (scrollTop >= this._dHeight) {
- top = this.condenses ? Math.max(this._dHeight, top) : top;
+ top = this.condenses && !this.fixed ? Math.max(this._dHeight, top) : top;
this.style.transitionDuration = '0ms';
}
@@ -248,9 +248,8 @@ Polymer({
if (isScrollingDown && scrollTop >= maxHeaderTop) {
top = maxHeaderTop;
} else if (!isScrollingDown && scrollTop >= this._dHeight) {
- top = this.condenses ? this._dHeight : 0;
+ top = this.condenses && !this.fixed ? this._dHeight : 0;
}
-
var scrollVelocity = dScrollTop / (now - this._lastTimestamp);
this.style.transitionDuration = this._clamp((top - lastTop) / scrollVelocity, 0, 300) + 'ms';
} else {
@@ -319,7 +318,6 @@ Polymer({
if (this._top === 0) {
return this._clampedScrollTop > 0;
}
-
return this._clampedScrollTop - this._maxHeaderTop >= 0;
},
@@ -330,7 +328,6 @@ Polymer({
*/
_transformHeader: function(y) {
this.translate3d(0, (-y) + 'px', 0);
-
if (this._primaryEl && this.condenses && y >= this._primaryElTop) {
this.translate3d(0, (Math.min(y, this._dHeight) - this._primaryElTop) + 'px', 0,
this._primaryEl);
@@ -345,6 +342,42 @@ Polymer({
return Math.min(max, Math.max(min, v));
},
+ _ensureBgContainers: function() {
+ if (!this._bgContainer) {
+ this._bgContainer = document.createElement('div');
+ this._bgContainer.id = 'background';
+
+ this._bgRear = document.createElement('div');
+ this._bgRear.id = 'backgroundRearLayer';
+ this._bgContainer.appendChild(this._bgRear);
+
+ this._bgFront = document.createElement('div');
+ this._bgFront.id = 'backgroundFrontLayer';
+ this._bgContainer.appendChild(this._bgFront);
+
+ Polymer.dom(this.root).insertBefore(this._bgContainer, this.$.contentContainer);
+ }
+ },
+
+ _getDOMRef: function(id) {
+ switch (id) {
+ case 'backgroundFrontLayer':
+ this._ensureBgContainers();
+ return this._bgFront;
+ case 'backgroundRearLayer':
+ this._ensureBgContainers();
+ return this._bgRear;
+ case 'background':
+ this._ensureBgContainers();
+ return this._bgContainer;
+ case 'title':
+ return Polymer.dom(this).querySelector('[title]');
+ case 'condensedTitle':
+ return Polymer.dom(this).querySelector('[condensed-title]');
+ }
+ return null;
+ },
+
/**
* Returns an object containing the progress value of the scroll effects
* and the top position of the header.

Powered by Google App Engine
This is Rietveld 408576698