vendor/assets/javascripts/material.js in material_design_lite-rails-1.1.0 vs vendor/assets/javascripts/material.js in material_design_lite-rails-1.1.1

- old
+ new

@@ -225,11 +225,11 @@ // Assign per element instance for control over API element[registeredClass.className] = instance; } } else { throw new Error( - 'Unable to find a registered component for the given class.'); + 'Unable to find a registered component for the given class.'); } var ev = document.createEvent('Events'); ev.initEvent('mdl-componentupgraded', true, true); element.dispatchEvent(ev); @@ -3211,17 +3211,22 @@ */ MaterialLayout.prototype.contentScrollHandler_ = function () { if (this.header_.classList.contains(this.CssClasses_.IS_ANIMATING)) { 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); + } } }; /** * Handles a keyboard event on the drawer. *