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

Unified Diff: third_party/polymer/v1_0/components-chromium/paper-dropdown-menu/paper-dropdown-menu-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-dropdown-menu/paper-dropdown-menu-extracted.js
diff --git a/third_party/polymer/v1_0/components-chromium/paper-dropdown-menu/paper-dropdown-menu-extracted.js b/third_party/polymer/v1_0/components-chromium/paper-dropdown-menu/paper-dropdown-menu-extracted.js
index 48c202c2b5a2cf01d3f54fcf797b4a8d07197d1e..ced348a6bc242c1c4cb29b7514c1be8772c01446 100644
--- a/third_party/polymer/v1_0/components-chromium/paper-dropdown-menu/paper-dropdown-menu-extracted.js
+++ b/third_party/polymer/v1_0/components-chromium/paper-dropdown-menu/paper-dropdown-menu-extracted.js
@@ -36,7 +36,7 @@
/**
* The last selected item. An item is selected if the dropdown menu has
* a child with class `dropdown-content`, and that child triggers an
- * `iron-activate` event with the selected `item` in the `detail`.
+ * `iron-select` event with the selected `item` in the `detail`.
*/
selectedItem: {
type: Object,
@@ -110,6 +110,24 @@
'aria-haspopup': 'true'
},
+ attached: function() {
+ // NOTE(cdata): Due to timing, a preselected value in a `IronSelectable`
+ // child will cause an `iron-select` event to fire while the element is
+ // still in a `DocumentFragment`. This has the effect of causing
+ // handlers not to fire. So, we double check this value on attached:
+ var contentElement = this.contentElement;
+ if (contentElement && contentElement.selectedItem) {
+ this._setSelectedItem(contentElement.selectedItem);
+ }
+ },
+
+ /**
+ * The content element that is contained by the dropdown menu, if any.
+ */
+ get contentElement() {
+ return Polymer.dom(this.$.content).getDistributedNodes()[0];
+ },
+
/**
* Show the dropdown content.
*/
@@ -125,11 +143,11 @@
},
/**
- * A handler that is called when `iron-activate` is fired.
+ * A handler that is called when `iron-select` is fired.
*
- * @param {CustomEvent} event An `iron-activate` event.
+ * @param {CustomEvent} event An `iron-select` event.
*/
- _onIronActivate: function(event) {
+ _onIronSelect: function(event) {
this._setSelectedItem(event.detail.item);
},

Powered by Google App Engine
This is Rietveld 408576698