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

Unified Diff: chrome/browser/resources/settings/device_page/display.js

Issue 2654433011: MD Settings: Display: Fix selected display update (Closed)
Patch Set: Created 3 years, 11 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/resources/settings/device_page/display.js
diff --git a/chrome/browser/resources/settings/device_page/display.js b/chrome/browser/resources/settings/device_page/display.js
index 31e25c81631220715146a2a2600aa36d837f94e8..d1ee75acdd7e449b3c23c4783c884d2b6254cf52 100644
--- a/chrome/browser/resources/settings/device_page/display.js
+++ b/chrome/browser/resources/settings/device_page/display.js
@@ -296,8 +296,13 @@ Polymer({
var display = this.displays[i];
if (id != display.id)
continue;
- this.currentSelectedModeIndex_ = -1;
- this.selectedDisplay = display;
+ if (this.selectedDisplay != display) {
+ // Set currentSelectedModeIndex_ to -1 so that getResolutionText_ does
+ // not flicker. selectedDisplayChanged will update selectedModeIndex_
+ // and currentSelectedModeIndex_ correctly.
+ this.currentSelectedModeIndex_ = -1;
+ this.selectedDisplay = display;
+ }
}
},
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698