Bug 1559873 - Fix accept buttons in calendar chooser dialog, add minimum dimensions. r=philipp
authorGeoff Lankow <geoff@darktrojan.net>
Tue, 18 Jun 2019 23:21:29 +1200
changeset 35988 a3bca02f23574e70ccc3a68ad6d3786173fdd0a9
parent 35987 1afa90fe67103f9b81f65ae94304489e8f74a595
child 35989 d72b6ee0f40f9c2df065353fb84e91ab2189c78f
push id392
push userclokep@gmail.com
push dateMon, 02 Sep 2019 20:17:19 +0000
reviewersphilipp
bugs1559873
Bug 1559873 - Fix accept buttons in calendar chooser dialog, add minimum dimensions. r=philipp
calendar/base/content/dialogs/chooseCalendarDialog.js
calendar/base/content/dialogs/chooseCalendarDialog.xul
--- a/calendar/base/content/dialogs/chooseCalendarDialog.js
+++ b/calendar/base/content/dialogs/chooseCalendarDialog.js
@@ -49,23 +49,23 @@ function loadCalendars() {
         }
     }
     document.getElementById("prompt").textContent = window.arguments[0].promptText;
     if (window.arguments[0].promptNotify) {
         document.getElementById("promptNotify").textContent = window.arguments[0].promptNotify;
     }
 
     // this button is the default action
-    let accept = document.getAnonymousElementByAttribute(document.documentElement, "dlgtype", "accept");
+    let accept = document.documentElement.getButton("accept");
     if (window.arguments[0].labelOk) {
         accept.setAttribute("label", window.arguments[0].labelOk);
         accept.removeAttribute("hidden");
     }
 
-    let extra1 = document.getAnonymousElementByAttribute(document.documentElement, "dlgtype", "extra1");
+    let extra1 = document.documentElement.getButton("extra1");
     if (window.arguments[0].labelExtra1) {
         extra1.setAttribute("label", window.arguments[0].labelExtra1);
         extra1.removeAttribute("hidden");
     } else {
         extra1.setAttribute("hidden", "true");
     }
 
     if (calendars.length) {
--- a/calendar/base/content/dialogs/chooseCalendarDialog.xul
+++ b/calendar/base/content/dialogs/chooseCalendarDialog.xul
@@ -12,16 +12,17 @@
 ]>
 
 <dialog id="chooseCalendar"
         title="&calendar.select.dialog.title;"
         windowtype="Calendar:CalendarPicker"
         xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" xmlns:html="http://www.w3.org/1999/xhtml"
         buttons="accept,cancel"
         onload="setTimeout(loadCalendars, 0);"
+        minheight="200" minwidth="300"
         persist="screenX screenY height width">
 
     <script src="chrome://calendar/content/calendar-ui-utils.js"/>
     <script src="chrome://calendar/content/chooseCalendarDialog.js"/>
 
     <vbox id="dialog-box" flex="1">
         <label id="prompt" control="calendar-list"/>
         <richlistbox id="calendar-list" flex="1" seltype="single"/>