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

Unified Diff: chrome/browser/resources/settings/internet_page/network_apnlist.js

Issue 2422423002: Use md-select instead of paper-dropdown-menu-light in internet page (Closed)
Patch Set: Use data binding + async Created 4 years, 2 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: chrome/browser/resources/settings/internet_page/network_apnlist.js
diff --git a/chrome/browser/resources/settings/internet_page/network_apnlist.js b/chrome/browser/resources/settings/internet_page/network_apnlist.js
index c6270f6b9de1f9f9c1efcb7ab83940ddc85b64c5..594e094afb4846a38ef3df34187a830dfd2d35d4 100644
--- a/chrome/browser/resources/settings/internet_page/network_apnlist.js
+++ b/chrome/browser/resources/settings/internet_page/network_apnlist.js
@@ -139,11 +139,11 @@ Polymer({
result.push(otherApn);
this.apnSelectList_ = result;
- this.selectedApn_ =
- (activeApn && activeApn.AccessPointName) || otherApn.AccessPointName;
- // We need to flush the DOM here, otherwise the paper-dropdown-menu-light
- // will not update to correctly display the selected AccessPointName.
- Polymer.dom.flush();
+ // Set selectedApn_ after dom-repeat has been stamped.
+ this.async(function() {
+ this.selectedApn_ =
+ (activeApn && activeApn.AccessPointName) || otherApn.AccessPointName;
+ }.bind(this));
},
/**
@@ -177,16 +177,18 @@ Polymer({
/**
* Event triggered when the selectApn selection changes.
- * @param {!{detail: !{selected: string}}} event
+ * @param {!Event} event
* @private
*/
onSelectApnChange_: function(event) {
- /** @type {string} */ var accessPointName = event.detail.selected;
+ let target = /** @type {!HTMLSelectElement} */(event.target);
+ var accessPointName = target.value;
// When selecting 'Other', don't set a change event unless a valid
// non-default value has been set for Other.
if (this.isOtherSelected_(accessPointName) &&
(!this.otherApn_ || !this.otherApn_.AccessPointName ||
this.otherApn_.AccessPointName == this.DefaultAccessPointName)) {
+ this.selectedApn_ = accessPointName;
return;
}
this.sendApnChange_(accessPointName);

Powered by Google App Engine
This is Rietveld 408576698