Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(5)

Unified Diff: third_party/polymer/v1_0/components-chromium/paper-menu-button/paper-menu-button-extracted.js

Issue 1336623003: [MD settings] updating polymer to 1.1.13 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: changed Polymer.IronCheckedElementBehavior name Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/polymer/v1_0/components-chromium/paper-menu-button/paper-menu-button-extracted.js
diff --git a/third_party/polymer/v1_0/components-chromium/paper-menu-button/paper-menu-button-extracted.js b/third_party/polymer/v1_0/components-chromium/paper-menu-button/paper-menu-button-extracted.js
index 33017087565143e7bada9c6ba0aaef41263ccfeb..f7539fe644bc895da35f101d520f95c6d65cd516 100644
--- a/third_party/polymer/v1_0/components-chromium/paper-menu-button/paper-menu-button-extracted.js
+++ b/third_party/polymer/v1_0/components-chromium/paper-menu-button/paper-menu-button-extracted.js
@@ -29,7 +29,8 @@
opened: {
type: Boolean,
value: false,
- notify: true
+ notify: true,
+ observer: '_openedChanged'
},
/**
@@ -87,7 +88,7 @@
* Set to true to disable automatically closing the dropdown after
* a selection has been made.
*/
- ignoreActivate: {
+ ignoreSelect: {
type: Boolean,
value: false
},
@@ -150,6 +151,14 @@
}
}];
}
+ },
+
+ /**
+ * This is the element intended to be bound as the focus target
+ * for the `iron-dropdown` contained by `paper-menu-button`.
+ */
+ _dropdownContent: {
+ type: Object
}
},
@@ -159,7 +168,14 @@
},
listeners: {
- 'iron-activate': '_onIronActivate'
+ 'iron-select': '_onIronSelect'
+ },
+
+ /**
+ * The content element that is contained by the menu button, if any.
+ */
+ get contentElement() {
+ return Polymer.dom(this.$.content).getDistributedNodes()[0];
},
/**
@@ -182,14 +198,14 @@
},
/**
- * When an `iron-activate` event is received, the dropdown should
+ * When an `iron-select` event is received, the dropdown should
* automatically close on the assumption that a value has been chosen.
*
* @param {CustomEvent} event A CustomEvent instance with type
- * set to `"iron-activate"`.
+ * set to `"iron-select"`.
*/
- _onIronActivate: function(event) {
- if (!this.ignoreActivate) {
+ _onIronSelect: function(event) {
+ if (!this.ignoreSelect) {
this.close();
}
},
@@ -203,6 +219,12 @@
*/
_openedChanged: function(opened, oldOpened) {
if (opened) {
+ // TODO(cdata): Update this when we can measure changes in distributed
+ // children in an idiomatic way.
+ // We poke this property in case the element has changed. This will
+ // cause the focus target for the `iron-dropdown` to be updated as
+ // necessary:
+ this._dropdownContent = this.contentElement;
this.fire('paper-dropdown-open');
} else if (oldOpened != null) {
this.fire('paper-dropdown-close');

Powered by Google App Engine
This is Rietveld 408576698