Bug 1475817 - Part 8: Convert simple <listbox> to <richlistbox> in calendar/providers/gdata. r=philipp
authorGeoff Lankow <geoff@darktrojan.net>
Wed, 18 Jul 2018 16:21:02 +1200
changeset 31770 d70436bc01deae26240f769ea22c7987901c77ca
parent 31769 2501e7eabc9f3e8d6272045175d34bc4aee59dd3
child 31771 7962d601822d193cccf877bba6c2f0e3908af7a9
push id2308
push userclokep@gmail.com
push dateWed, 05 Sep 2018 00:34:58 +0000
treeherdercomm-beta@e326b2dcd127 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersphilipp
bugs1475817
Bug 1475817 - Part 8: Convert simple <listbox> to <richlistbox> in calendar/providers/gdata. r=philipp
calendar/providers/gdata/content/gdata-migration-wizard.xul
calendar/providers/gdata/content/gdata-migration.js
--- a/calendar/providers/gdata/content/gdata-migration-wizard.xul
+++ b/calendar/providers/gdata/content/gdata-migration-wizard.xul
@@ -19,11 +19,11 @@
         width="300"
         height="300"
         xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
   <script type="application/javascript" src="chrome://gdata-provider/content/gdata-migration.js"/>
   <script type="application/javascript" src="chrome://calendar/content/calendar-views.js"/>
   <script type="application/javascript" src="chrome://calendar/content/calendar-ui-utils.js"/>
 
   <description>&gdata.migration.description;</description>
-  <listbox id="calendars-listbox" flex="1"/>
+  <vbox id="calendars-listbox" flex="1"/>
   <checkbox id="showagain-checkbox" label="&gdata.migration.showagain.label;"/>
 </dialog>
--- a/calendar/providers/gdata/content/gdata-migration.js
+++ b/calendar/providers/gdata/content/gdata-migration.js
@@ -72,19 +72,21 @@ function getMigratableCalendars() {
  * Load Handler for both the wizard and the Thunderbird main window.
  */
 function gdata_migration_loader() {
     if (document.documentElement.id == "gdata-migration-wizard") {
         // This is the migration wizard, load the calendars neeeded.
         let listbox = document.getElementById("calendars-listbox");
 
         for (let calendar of sortCalendarArray(getMigratableCalendars())) {
-            let item = listbox.appendItem(calendar.name, calendar.id);
-            item.setAttribute("type", "checkbox");
+            let item = document.createElement("checkbox");
+            item.setAttribute("label", calendar.name);
+            item.setAttribute("value", calendar.id);
             item.calendar = calendar;
+            listbox.appendChild(item);
         }
 
         // Set up the "always check" field
         document.getElementById("showagain-checkbox").checked =
             Preferences.get("calendar.google.migrate", true);
     } else if (Preferences.get("calendar.google.migrate", true) &&
                getMigratableCalendars().length > 0) {
         // This is not the migration wizard, so it must be a main window. Check