Bug 1266411 - Alphabetically sort the user selected devices. r=jryans, ui-r=hholmes
authorJaideep Bhoosreddy <jaideepb@buffalo.edu>
Tue, 24 May 2016 19:18:00 -0400
changeset 299099 25566a14a7ac98674bfe9b6e73edc59fcc286c22
parent 299098 4f75d0cc90d12974b5b2b487bd63f17626f9e20d
child 299100 53942df4f3849739a4ba389656a283c3c48e01b9
push id30289
push userryanvm@gmail.com
push dateThu, 26 May 2016 15:21:32 +0000
treeherdermozilla-central@b0096c5c7277 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjryans, hholmes
bugs1266411
milestone49.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1266411 - Alphabetically sort the user selected devices. r=jryans, ui-r=hholmes
devtools/client/responsive.html/components/device-selector.js
--- a/devtools/client/responsive.html/components/device-selector.js
+++ b/devtools/client/responsive.html/components/device-selector.js
@@ -59,16 +59,20 @@ module.exports = createClass({
     for (let type of devices.types) {
       for (let device of devices[type]) {
         if (device.displayed) {
           options.push(device);
         }
       }
     }
 
+    options.sort(function (a, b) {
+      return a.name.localeCompare(b.name);
+    });
+
     let selectClass = "viewport-device-selector";
     if (selectedDevice) {
       selectClass += " selected";
     }
 
     return dom.select(
       {
         className: selectClass,