mirror of
https://github.com/google/material-design-lite.git
synced 2024-09-11 12:25:38 +03:00
Merge pull request #4064 from google/fix-waterfall-on-small-screen
Fix issues with waterfall headers on small screens. Fixes #4058.
This commit is contained in:
commit
d5401ff1d2
@ -137,16 +137,24 @@
|
||||
return;
|
||||
}
|
||||
|
||||
var headerVisible =
|
||||
!this.element_.classList.contains(this.CssClasses_.IS_SMALL_SCREEN) ||
|
||||
this.element_.classList.contains(this.CssClasses_.FIXED_HEADER);
|
||||
|
||||
if (this.content_.scrollTop > 0 &&
|
||||
!this.header_.classList.contains(this.CssClasses_.IS_COMPACT)) {
|
||||
this.header_.classList.add(this.CssClasses_.CASTING_SHADOW);
|
||||
this.header_.classList.add(this.CssClasses_.IS_COMPACT);
|
||||
this.header_.classList.add(this.CssClasses_.IS_ANIMATING);
|
||||
if (headerVisible) {
|
||||
this.header_.classList.add(this.CssClasses_.IS_ANIMATING);
|
||||
}
|
||||
} else if (this.content_.scrollTop <= 0 &&
|
||||
this.header_.classList.contains(this.CssClasses_.IS_COMPACT)) {
|
||||
this.header_.classList.remove(this.CssClasses_.CASTING_SHADOW);
|
||||
this.header_.classList.remove(this.CssClasses_.IS_COMPACT);
|
||||
this.header_.classList.add(this.CssClasses_.IS_ANIMATING);
|
||||
if (headerVisible) {
|
||||
this.header_.classList.add(this.CssClasses_.IS_ANIMATING);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user