| OLD | NEW |
| 1 | 1 |
| 2 (function() { | 2 (function() { |
| 3 'use strict'; | 3 'use strict'; |
| 4 | 4 |
| 5 Polymer({ | 5 Polymer({ |
| 6 is: 'iron-dropdown', | 6 is: 'iron-dropdown', |
| 7 | 7 |
| 8 behaviors: [ | 8 behaviors: [ |
| 9 Polymer.IronControlState, | 9 Polymer.IronControlState, |
| 10 Polymer.IronA11yKeysBehavior, | 10 Polymer.IronA11yKeysBehavior, |
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 91 /** | 91 /** |
| 92 * Set to true to disable animations when opening and closing the | 92 * Set to true to disable animations when opening and closing the |
| 93 * dropdown. | 93 * dropdown. |
| 94 */ | 94 */ |
| 95 noAnimations: { | 95 noAnimations: { |
| 96 type: Boolean, | 96 type: Boolean, |
| 97 value: false | 97 value: false |
| 98 }, | 98 }, |
| 99 | 99 |
| 100 /** | 100 /** |
| 101 * By default, the dropdown will constrain scrolling on the page |
| 102 * to itself when opened. |
| 103 * Set to true in order to prevent scroll from being constrained |
| 104 * to the dropdown when it opens. |
| 105 */ |
| 106 allowOutsideScroll: { |
| 107 type: Boolean, |
| 108 value: false |
| 109 }, |
| 110 |
| 111 /** |
| 101 * We memoize the positionTarget bounding rectangle so that we can | 112 * We memoize the positionTarget bounding rectangle so that we can |
| 102 * limit the number of times it is queried per resize / relayout. | 113 * limit the number of times it is queried per resize / relayout. |
| 103 * @type {?Object} | 114 * @type {?Object} |
| 104 */ | 115 */ |
| 105 _positionRectMemo: { | 116 _positionRectMemo: { |
| 106 type: Object | 117 type: Object |
| 107 } | 118 } |
| 108 }, | 119 }, |
| 109 | 120 |
| 110 listeners: { | 121 listeners: { |
| (...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 210 | 221 |
| 211 if (this.opened) { | 222 if (this.opened) { |
| 212 this._focusContent(); | 223 this._focusContent(); |
| 213 } | 224 } |
| 214 }, | 225 }, |
| 215 | 226 |
| 216 /** | 227 /** |
| 217 * Overridden from `IronOverlayBehavior`. | 228 * Overridden from `IronOverlayBehavior`. |
| 218 */ | 229 */ |
| 219 _renderOpened: function() { | 230 _renderOpened: function() { |
| 220 Polymer.IronDropdownScrollManager.pushScrollLock(this); | 231 if (!this.allowOutsideScroll) { |
| 232 Polymer.IronDropdownScrollManager.pushScrollLock(this); |
| 233 } |
| 234 |
| 221 if (!this.noAnimations && this.animationConfig && this.animationConfig
.open) { | 235 if (!this.noAnimations && this.animationConfig && this.animationConfig
.open) { |
| 222 this.$.contentWrapper.classList.add('animating'); | 236 this.$.contentWrapper.classList.add('animating'); |
| 223 this.playAnimation('open'); | 237 this.playAnimation('open'); |
| 224 } else { | 238 } else { |
| 225 Polymer.IronOverlayBehaviorImpl._renderOpened.apply(this, arguments)
; | 239 Polymer.IronOverlayBehaviorImpl._renderOpened.apply(this, arguments)
; |
| 226 } | 240 } |
| 227 }, | 241 }, |
| 228 | 242 |
| 229 /** | 243 /** |
| 230 * Overridden from `IronOverlayBehavior`. | 244 * Overridden from `IronOverlayBehavior`. |
| (...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 365 // `display: none` is removed from the element. | 379 // `display: none` is removed from the element. |
| 366 this.async(function() { | 380 this.async(function() { |
| 367 if (this._focusTarget) { | 381 if (this._focusTarget) { |
| 368 this._focusTarget.focus(); | 382 this._focusTarget.focus(); |
| 369 } | 383 } |
| 370 }); | 384 }); |
| 371 } | 385 } |
| 372 }); | 386 }); |
| 373 })(); | 387 })(); |
| 374 | 388 |
| OLD | NEW |