3 Polymer('core-dropdown-base',{
8 * True if the menu is open.
19 'tap': 'toggleOverlay'
23 'core-overlay-open': 'openAction'
27 if (!this._dropdown) {
28 this._dropdown = this.querySelector('.dropdown');
29 for (var l in this.overlayListeners) {
30 this.addElementListener(this._dropdown, l, this.overlayListeners[l]);
33 return this._dropdown;
36 attached: function() {
37 // find the dropdown on attach
42 addElementListener: function(node, event, methodName, capture) {
43 var fn = this._makeBoundListener(methodName);
45 Polymer.addEventListener(node, event, fn, capture);
49 removeElementListener: function(node, event, methodName, capture) {
50 var fn = this._makeBoundListener(methodName);
52 Polymer.removeEventListener(node, event, fn, capture);
56 _makeBoundListener: function(methodName) {
57 var self = this, method = this[methodName];
61 var bound = '_bound' + methodName;
63 this[bound] = function(e) {
70 openedChanged: function() {
74 var dropdown = this.dropdown;
76 dropdown.opened = this.opened;
80 openAction: function(e) {
81 this.opened = !!e.detail;
84 toggleOverlay: function() {
85 this.opened = !this.opened;