Added support for hero text

This commit is contained in:
Martin Donath
2017-11-22 00:13:56 +01:00
committed by GitHub
parent 50d69fd428
commit f033fd5437
22 changed files with 244 additions and 86 deletions

View File

@@ -76,11 +76,18 @@ export default class Shadow {
/**
* Update shadow state
*
* @param {Event} ev - Event
*/
update() {
const active = window.pageYOffset >= this.height_
if (active !== this.active_)
this.header_.dataset.mdState = (this.active_ = active) ? "shadow" : ""
update(ev) {
if (ev && (ev.type === "resize" || ev.type === "orientationchange")) {
this.height_ = 0
this.setup()
} else {
const active = window.pageYOffset >= this.height_
if (active !== this.active_)
this.header_.dataset.mdState = (this.active_ = active) ? "shadow" : ""
}
}
/**