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

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

Issue 2097763004: MD Settings: Display: Add snapping and collisions (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@issue_547080_display_settings8a_drag
Patch Set: Rebase + More Feedback Created 4 years, 6 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/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 17af4583e5a47c35370cc7650de9cc3cb0bd5990..5b83b075579f10bada5cda397170860ad90c5332 100644
--- a/chrome/browser/resources/settings/device_page/display.js
+++ b/chrome/browser/resources/settings/device_page/display.js
@@ -233,17 +233,16 @@ Polymer({
},
/**
- * @param {!{detail: number}} e
+ * @param {!{detail: string}} e |e.detail| is the id of the selected display.
* @private
*/
onSelectDisplay_: function(e) {
- var index = e.detail;
- assert(index >= 0);
- if (index >= this.displays.length)
- return;
- this.selectedDisplay = this.displays[e.detail];
- // Force active in case selected display was clicked.
- e.target.active = true;
+ var id = e.detail;
+ for (let display of this.displays) {
+ if (id != display.id)
+ continue;
+ this.selectedDisplay = display;
+ }
},
/** @private */

Powered by Google App Engine
This is Rietveld 408576698