| OLD | NEW |
| (Empty) |
| 1 | |
| 2 | |
| 3 (function() { | |
| 4 | |
| 5 var p = { | |
| 6 | |
| 7 publish: { | |
| 8 | |
| 9 /** | |
| 10 * A label for the control. The label is displayed if no item is selected. | |
| 11 * | |
| 12 * @attribute label | |
| 13 * @type string | |
| 14 * @default 'Select an item' | |
| 15 */ | |
| 16 label: 'Select an item', | |
| 17 | |
| 18 /** | |
| 19 * The icon to display when the drop-down is opened. | |
| 20 * | |
| 21 * @attribute openedIcon | |
| 22 * @type string | |
| 23 * @default 'arrow-drop-up' | |
| 24 */ | |
| 25 openedIcon: 'arrow-drop-up', | |
| 26 | |
| 27 /** | |
| 28 * The icon to display when the drop-down is closed. | |
| 29 * | |
| 30 * @attribute closedIcon | |
| 31 * @type string | |
| 32 * @default 'arrow-drop-down' | |
| 33 */ | |
| 34 closedIcon: 'arrow-drop-down' | |
| 35 | |
| 36 }, | |
| 37 | |
| 38 selectedItemLabel: '', | |
| 39 | |
| 40 overlayListeners: { | |
| 41 'core-overlay-open': 'openAction', | |
| 42 'core-activate': 'activateAction', | |
| 43 'core-select': 'selectAction' | |
| 44 }, | |
| 45 | |
| 46 activateAction: function(e) { | |
| 47 this.opened = false; | |
| 48 }, | |
| 49 | |
| 50 selectAction: function(e) { | |
| 51 var detail = e.detail; | |
| 52 if (detail.isSelected) { | |
| 53 this.selectedItemLabel = detail.item.label || detail.item.textContent; | |
| 54 } else { | |
| 55 this.selectedItemLabel = ''; | |
| 56 } | |
| 57 } | |
| 58 | |
| 59 }; | |
| 60 | |
| 61 Polymer.mixin2(p, Polymer.CoreFocusable); | |
| 62 Polymer('core-dropdown-menu',p); | |
| 63 | |
| 64 })(); | |
| 65 | |
| OLD | NEW |