3 Polymer('core-dropdown',{
8 * True if the menu is open.
17 * A label for the control. The label is displayed if no item is selected.
21 * @default 'Select an item'
23 label
: 'Select an item',
26 * The currently selected element. By default this is the index of the item element.
27 * If you want a specific attribute value of the element to be used instead of the
28 * index, set `valueattr` to that attribute name.
37 * Specifies the attribute to be used for "selected" attribute.
39 * @attribute valueattr
46 * Specifies the CSS class to be used to add to the selected element.
48 * @attribute selectedClass
50 * @default 'core-selected'
52 selectedClass
: 'core-selected',
55 * Specifies the property to be used to set on the selected element
56 * to indicate its active state.
58 * @attribute selectedProperty
65 * Specifies the attribute to set on the selected element to indicate
68 * @attribute selectedAttribute
72 selectedAttribute
: 'selected',
75 * The currently selected element.
77 * @attribute selectedItem
84 * Horizontally align the overlay with the control.
86 * @type "left"|"right"
89 halign
: {value
: 'left', reflect
: true},
92 * Vertically align the dropdown menu with the control.
94 * @type "top"|"bottom"
97 valign
: {value
: 'bottom', reflect
: true}
102 this.opened
= !this.opened
;
105 openAction: function(e
) {
107 var rect
= this.$.control
.getBoundingClientRect();
108 if (this.valign
=== 'top') {
109 this.$.menu
.style
.top
= 'auto';
110 this.$.menu
.style
.bottom
= rect
.height
+ 'px';
111 this.$.menu
.style
.maxHeight
= (window
.innerHeight
- (window
.innerHeight
- rect
.top
) - 12) + 'px';
113 this.$.menu
.style
.top
= rect
.height
+ 'px';
114 this.$.menu
.style
.bottom
= 'auto';
115 this.$.menu
.style
.maxHeight
= (window
.innerHeight
- rect
.height
- rect
.top
- 12) + 'px';
117 this.$.menu
.style
.minWidth
= rect
.width
+ 'px';
121 selectAction: function() {