Chromium Code Reviews| Index: third_party/WebKit/Source/devtools/front_end/components/NetworkConditionsSelector.js |
| diff --git a/third_party/WebKit/Source/devtools/front_end/components/NetworkConditionsSelector.js b/third_party/WebKit/Source/devtools/front_end/components/NetworkConditionsSelector.js |
| index fc19d6e08fe92bae648728321f050f37230e72b3..81f67e82efe158cb9c5e49bf0605f59c8e76bef0 100644 |
| --- a/third_party/WebKit/Source/devtools/front_end/components/NetworkConditionsSelector.js |
| +++ b/third_party/WebKit/Source/devtools/front_end/components/NetworkConditionsSelector.js |
| @@ -81,7 +81,7 @@ Components.NetworkConditionsSelector = class { |
| var group = groups[i]; |
| var groupElement = selectElement.createChild('optgroup'); |
| groupElement.label = group.title; |
| - if (!i) { |
| + if (i === groups.length - 1) { |
|
caseq
2016/12/21 00:22:45
Don't you want this to be the last?
|
| groupElement.appendChild(new Option(Common.UIString('Add\u2026'), Common.UIString('Add\u2026'))); |
| options.push(null); |
| } |
| @@ -97,7 +97,7 @@ Components.NetworkConditionsSelector = class { |
| } |
| function optionSelected() { |
| - if (selectElement.selectedIndex === 0) |
| + if (selectElement.selectedIndex === selectElement.options.length - 1) |
| selector.revealAndUpdate(); |
| else |
| selector.optionSelected(options[selectElement.selectedIndex]); |
| @@ -200,7 +200,7 @@ Components.NetworkConditionsSelector = class { |
| var customGroup = {title: Common.UIString('Custom'), items: this._customSetting.get()}; |
| var presetsGroup = {title: Common.UIString('Presets'), items: Components.NetworkConditionsSelector._presets}; |
| var disabledGroup = {title: Common.UIString('Disabled'), items: [SDK.NetworkManager.NoThrottlingConditions]}; |
| - this._options = this._populateCallback([customGroup, presetsGroup, disabledGroup]); |
| + this._options = this._populateCallback([disabledGroup, presetsGroup, customGroup]); |
| if (!this._conditionsChanged()) { |
| for (var i = this._options.length - 1; i >= 0; i--) { |
| if (this._options[i]) { |