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

Unified Diff: chrome/browser/resources/settings/controls/settings_dropdown_menu.js

Issue 2235093002: Fix Loading text for settings-dropdown-menu (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 years, 4 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
« no previous file with comments | « no previous file | chrome/test/data/webui/settings/dropdown_menu_tests.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/resources/settings/controls/settings_dropdown_menu.js
diff --git a/chrome/browser/resources/settings/controls/settings_dropdown_menu.js b/chrome/browser/resources/settings/controls/settings_dropdown_menu.js
index 56d27d2c29f6822624292ea6945516a9ae93af1b..2982d7c2e2372ca9022c9a5a2ad42e600da09388 100644
--- a/chrome/browser/resources/settings/controls/settings_dropdown_menu.js
+++ b/chrome/browser/resources/settings/controls/settings_dropdown_menu.js
@@ -35,7 +35,7 @@ Polymer({
/**
* List of options for the drop-down menu.
- * @type {DropdownMenuOptionList}
+ * @type {!DropdownMenuOptionList}
*/
menuOptions: {
type: Array,
@@ -120,7 +120,7 @@ Polymer({
* @private
*/
updateSelected_: function() {
- if (!this.pref)
+ if (!this.pref || !this.menuOptions.length)
return;
var prefValue = this.pref.value;
var option = this.menuOptions.find(function(menuItem) {
@@ -138,7 +138,7 @@ Polymer({
* @private
*/
isSelectedNotFound_: function(selected) {
- return this.menuOptions && selected == this.notFoundValue_;
+ return this.menuOptions.length > 0 && selected == this.notFoundValue_;
},
/**
« no previous file with comments | « no previous file | chrome/test/data/webui/settings/dropdown_menu_tests.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698