| OLD | NEW |
| 1 <!-- | 1 <!-- |
| 2 Copyright (c) 2014 The Polymer Project Authors. All rights reserved. | 2 Copyright (c) 2014 The Polymer Project Authors. All rights reserved. |
| 3 This code may only be used under the BSD style license found at http://polymer.g
ithub.io/LICENSE.txt | 3 This code may only be used under the BSD style license found at http://polymer.g
ithub.io/LICENSE.txt |
| 4 The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt | 4 The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt |
| 5 The complete set of contributors may be found at http://polymer.github.io/CONTRI
BUTORS.txt | 5 The complete set of contributors may be found at http://polymer.github.io/CONTRI
BUTORS.txt |
| 6 Code distributed by Google as part of the polymer project is also | 6 Code distributed by Google as part of the polymer project is also |
| 7 subject to an additional IP rights grant found at http://polymer.github.io/PATEN
TS.txt | 7 subject to an additional IP rights grant found at http://polymer.github.io/PATEN
TS.txt |
| 8 --> | 8 --> |
| 9 | 9 |
| 10 <!-- | 10 <!-- |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 85 | 85 |
| 86 <div id="dropShadow"></div> | 86 <div id="dropShadow"></div> |
| 87 | 87 |
| 88 </div> | 88 </div> |
| 89 | 89 |
| 90 </div> | 90 </div> |
| 91 | 91 |
| 92 </template> | 92 </template> |
| 93 <script> | 93 <script> |
| 94 | 94 |
| 95 Polymer('core-header-panel', { | 95 Polymer({ |
| 96 | 96 |
| 97 /** | 97 /** |
| 98 * Fired when the content has been scrolled. `event.detail.target` returns | 98 * Fired when the content has been scrolled. `event.detail.target` returns |
| 99 * the scrollable element which you can use to access scroll info such as | 99 * the scrollable element which you can use to access scroll info such as |
| 100 * `scrollTop`. | 100 * `scrollTop`. |
| 101 * | 101 * |
| 102 * <core-header-panel on-scroll="{{scrollHandler}}"> | 102 * <core-header-panel on-scroll="{{scrollHandler}}"> |
| 103 * ... | 103 * ... |
| 104 * </core-header-panel> | 104 * </core-header-panel> |
| 105 * | 105 * |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 140 * <style> | 140 * <style> |
| 141 * core-header-panel[mode=cover]::shadow #mainContainer { | 141 * core-header-panel[mode=cover]::shadow #mainContainer { |
| 142 * left: 80px; | 142 * left: 80px; |
| 143 * } | 143 * } |
| 144 * .content { | 144 * .content { |
| 145 * margin: 60px 60px 60px 0; | 145 * margin: 60px 60px 60px 0; |
| 146 * } | 146 * } |
| 147 * </style> | 147 * </style> |
| 148 * | 148 * |
| 149 * <core-header-panel mode="cover"> | 149 * <core-header-panel mode="cover"> |
| 150 * <core-appbar class="tall"> | 150 * <core-toolbar class="tall"> |
| 151 * <core-icon-button icon="menu"></core-icon-button> | 151 * <core-icon-button icon="menu"></core-icon-button> |
| 152 * </core-appbar> | 152 * </core-toolbar> |
| 153 * <div class="content"></div> | 153 * <div class="content"></div> |
| 154 * </core-header-panel> | 154 * </core-header-panel> |
| 155 * | 155 * |
| 156 * @attribute mode | 156 * @attribute mode |
| 157 * @type string | 157 * @type string |
| 158 * @default '' | 158 * @default '' |
| 159 */ | 159 */ |
| 160 mode: {value: '', reflect: true}, | 160 mode: {value: '', reflect: true}, |
| 161 | 161 |
| 162 /** | 162 /** |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 204 removeListener: function(mode) { | 204 removeListener: function(mode) { |
| 205 var s = this.getScrollerForMode(mode); | 205 var s = this.getScrollerForMode(mode); |
| 206 s.removeEventListener('scroll', this.scrollHandler); | 206 s.removeEventListener('scroll', this.scrollHandler); |
| 207 }, | 207 }, |
| 208 | 208 |
| 209 domReady: function() { | 209 domReady: function() { |
| 210 this.async('scroll'); | 210 this.async('scroll'); |
| 211 }, | 211 }, |
| 212 | 212 |
| 213 modeChanged: function(old) { | 213 modeChanged: function(old) { |
| 214 var configs = this.modeConfigs; |
| 214 var header = this.header; | 215 var header = this.header; |
| 215 if (header) { | 216 if (header) { |
| 216 var configs = this.modeConfigs; | |
| 217 // in tallMode it may add tallClass to the header; so do the cleanup | 217 // in tallMode it may add tallClass to the header; so do the cleanup |
| 218 // when mode is changed from tallMode to not tallMode | 218 // when mode is changed from tallMode to not tallMode |
| 219 if (configs.tallMode[old] && !configs.tallMode[this.mode]) { | 219 if (configs.tallMode[old] && !configs.tallMode[this.mode]) { |
| 220 header.classList.remove(this.tallClass); | 220 header.classList.remove(this.tallClass); |
| 221 this.async(function() { | 221 this.async(function() { |
| 222 header.classList.remove('animate'); | 222 header.classList.remove('animate'); |
| 223 }, null, this.animateDuration); | 223 }, null, this.animateDuration); |
| 224 } else { | 224 } else { |
| 225 header.classList.toggle('animate', configs.tallMode[this.mode]); | 225 header.classList.toggle('animate', configs.tallMode[this.mode]); |
| 226 } | 226 } |
| 227 } | 227 } |
| 228 if (configs.outerScroll[this.mode] || configs.outerScroll[old]) { | 228 if (configs && (configs.outerScroll[this.mode] || configs.outerScroll[old]
)) { |
| 229 this.removeListener(old); | 229 this.removeListener(old); |
| 230 this.addListener(); | 230 this.addListener(); |
| 231 } | 231 } |
| 232 this.scroll(); | 232 this.scroll(); |
| 233 }, | 233 }, |
| 234 | 234 |
| 235 get header() { | 235 get header() { |
| 236 return this.$.headerContent.getDistributedNodes()[0]; | 236 return this.$.headerContent.getDistributedNodes()[0]; |
| 237 }, | 237 }, |
| 238 | 238 |
| (...skipping 29 matching lines...) Expand all Loading... |
| 268 main.scrollHeight < this.$.outerContainer.offsetHeight); | 268 main.scrollHeight < this.$.outerContainer.offsetHeight); |
| 269 } | 269 } |
| 270 | 270 |
| 271 this.fire('scroll', {target: this.scroller}, this, false); | 271 this.fire('scroll', {target: this.scroller}, this, false); |
| 272 } | 272 } |
| 273 | 273 |
| 274 }); | 274 }); |
| 275 | 275 |
| 276 </script> | 276 </script> |
| 277 </polymer-element> | 277 </polymer-element> |
| OLD | NEW |