| OLD | NEW |
| 1 (function() { | 1 (function() { |
| 2 'use strict'; | 2 'use strict'; |
| 3 | 3 |
| 4 var SHADOW_WHEN_SCROLLING = 1; | 4 var SHADOW_WHEN_SCROLLING = 1; |
| 5 var SHADOW_ALWAYS = 2; | 5 var SHADOW_ALWAYS = 2; |
| 6 var MODE_CONFIGS = { | 6 var MODE_CONFIGS = { |
| 7 outerScroll: { | 7 outerScroll: { |
| 8 'scroll': true | 8 'scroll': true |
| 9 }, | 9 }, |
| 10 | 10 |
| (...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 199 | 199 |
| 200 if (header) { | 200 if (header) { |
| 201 // in tallMode it may add tallClass to the header; so do the cleanup | 201 // in tallMode it may add tallClass to the header; so do the cleanup |
| 202 // when mode is changed from tallMode to not tallMode | 202 // when mode is changed from tallMode to not tallMode |
| 203 if (configs.tallMode[oldMode] && !configs.tallMode[newMode]) { | 203 if (configs.tallMode[oldMode] && !configs.tallMode[newMode]) { |
| 204 header.classList.remove(this.tallClass); | 204 header.classList.remove(this.tallClass); |
| 205 this.async(function() { | 205 this.async(function() { |
| 206 header.classList.remove('animate'); | 206 header.classList.remove('animate'); |
| 207 }, animateDuration); | 207 }, animateDuration); |
| 208 } else { | 208 } else { |
| 209 header.classList.toggle('animate', configs.tallMode[newMode]); | 209 this.toggleClass('animate', configs.tallMode[newMode], header); |
| 210 } | 210 } |
| 211 } | 211 } |
| 212 this._keepScrollingState(); | 212 this._keepScrollingState(); |
| 213 }, | 213 }, |
| 214 | 214 |
| 215 _keepScrollingState: function() { | 215 _keepScrollingState: function() { |
| 216 var main = this.scroller; | 216 var main = this.scroller; |
| 217 var header = this.header; | 217 var header = this.header; |
| 218 | 218 |
| 219 this._setAtTop(main.scrollTop === 0); | 219 this._setAtTop(main.scrollTop === 0); |
| 220 | 220 |
| 221 if (header && this.tallClass && MODE_CONFIGS.tallMode[this.mode]) { | 221 if (header && this.tallClass && MODE_CONFIGS.tallMode[this.mode]) { |
| 222 this.toggleClass(this.tallClass, this.atTop || | 222 this.toggleClass(this.tallClass, this.atTop || |
| 223 header.classList.contains(this.tallClass) && | 223 header.classList.contains(this.tallClass) && |
| 224 main.scrollHeight < this.offsetHeight, header); | 224 main.scrollHeight < this.offsetHeight, header); |
| 225 } | 225 } |
| 226 }, | 226 }, |
| 227 | 227 |
| 228 _scroll: function() { | 228 _scroll: function() { |
| 229 this._keepScrollingState(); | 229 this._keepScrollingState(); |
| 230 this.fire('content-scroll', {target: this.scroller}, {bubbles: false})
; | 230 this.fire('content-scroll', {target: this.scroller}, {bubbles: false})
; |
| 231 }, | 231 }, |
| 232 | 232 |
| 233 _getScrollerForMode: function(mode) { | 233 _getScrollerForMode: function(mode) { |
| 234 return MODE_CONFIGS.outerScroll[mode] ? | 234 return MODE_CONFIGS.outerScroll[mode] ? |
| 235 this : this.$.mainContainer; | 235 this : this.$.mainContainer; |
| 236 } | 236 } |
| 237 }); | 237 }); |
| 238 })(); | 238 })(); |
| OLD | NEW |