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