| OLD | NEW |
| 1 (function() { | 1 (function() { |
| 2 'use strict'; | 2 'use strict'; |
| 3 | 3 |
| 4 Polymer({ | 4 Polymer({ |
| 5 is: 'paper-dropdown-menu', | 5 is: 'paper-dropdown-menu', |
| 6 | 6 |
| 7 behaviors: [ | 7 behaviors: [ |
| 8 Polymer.IronButtonState, | 8 Polymer.IronButtonState, |
| 9 Polymer.IronControlState, | 9 Polymer.IronControlState, |
| 10 Polymer.IronFormElementBehavior, | 10 Polymer.IronFormElementBehavior, |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 72 * True if the dropdown is open. Otherwise, false. | 72 * True if the dropdown is open. Otherwise, false. |
| 73 */ | 73 */ |
| 74 opened: { | 74 opened: { |
| 75 type: Boolean, | 75 type: Boolean, |
| 76 notify: true, | 76 notify: true, |
| 77 value: false, | 77 value: false, |
| 78 observer: '_openedChanged' | 78 observer: '_openedChanged' |
| 79 }, | 79 }, |
| 80 | 80 |
| 81 /** | 81 /** |
| 82 * By default, the dropdown will constrain scrolling on the page |
| 83 * to itself when opened. |
| 84 * Set to true in order to prevent scroll from being constrained |
| 85 * to the dropdown when it opens. |
| 86 */ |
| 87 allowOutsideScroll: { |
| 88 type: Boolean, |
| 89 value: false |
| 90 }, |
| 91 |
| 92 /** |
| 82 * Set to true to disable the floating label. Bind this to the | 93 * Set to true to disable the floating label. Bind this to the |
| 83 * `<paper-input-container>`'s `noLabelFloat` property. | 94 * `<paper-input-container>`'s `noLabelFloat` property. |
| 84 */ | 95 */ |
| 85 noLabelFloat: { | 96 noLabelFloat: { |
| 86 type: Boolean, | 97 type: Boolean, |
| 87 value: false, | 98 value: false, |
| 88 reflectToAttribute: true | 99 reflectToAttribute: true |
| 89 }, | 100 }, |
| 90 | 101 |
| 91 /** | 102 /** |
| (...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 209 * Compute the label for the dropdown given a selected item. | 220 * Compute the label for the dropdown given a selected item. |
| 210 * | 221 * |
| 211 * @param {Element} selectedItem A selected Element item, with an | 222 * @param {Element} selectedItem A selected Element item, with an |
| 212 * optional `label` property. | 223 * optional `label` property. |
| 213 */ | 224 */ |
| 214 _selectedItemChanged: function(selectedItem) { | 225 _selectedItemChanged: function(selectedItem) { |
| 215 var value = ''; | 226 var value = ''; |
| 216 if (!selectedItem) { | 227 if (!selectedItem) { |
| 217 value = ''; | 228 value = ''; |
| 218 } else { | 229 } else { |
| 219 value = selectedItem.label || selectedItem.textContent.trim(); | 230 value = selectedItem.label || selectedItem.getAttribute('label') ||
selectedItem.textContent.trim(); |
| 220 } | 231 } |
| 221 | 232 |
| 222 this._setValue(value); | 233 this._setValue(value); |
| 223 this._setSelectedItemLabel(value); | 234 this._setSelectedItemLabel(value); |
| 224 }, | 235 }, |
| 225 | 236 |
| 226 /** | 237 /** |
| 227 * Compute the vertical offset of the menu based on the value of | 238 * Compute the vertical offset of the menu based on the value of |
| 228 * `noLabelFloat`. | 239 * `noLabelFloat`. |
| 229 * | 240 * |
| (...skipping 21 matching lines...) Expand all Loading... |
| 251 | 262 |
| 252 _openedChanged: function() { | 263 _openedChanged: function() { |
| 253 var openState = this.opened ? 'true' : 'false'; | 264 var openState = this.opened ? 'true' : 'false'; |
| 254 var e = this.contentElement; | 265 var e = this.contentElement; |
| 255 if (e) { | 266 if (e) { |
| 256 e.setAttribute('aria-expanded', openState); | 267 e.setAttribute('aria-expanded', openState); |
| 257 } | 268 } |
| 258 } | 269 } |
| 259 }); | 270 }); |
| 260 })(); | 271 })(); |
| OLD | NEW |