Bug 1568224 - remove grid usage from calendar-error-prompt.xul. r=pmorris
authorKhushil Mistry <khushil324@gmail.com>
Wed, 14 Aug 2019 01:30:00 +0200
changeset 27324 f354e2beb4942767856a4018435e44247407e1d2
parent 27323 1258058e269afaa92c16e175091f3b96ebc9be60
child 27325 82fde34332727c5a9e1128299cba660089b72289
push id16282
push usermozilla@jorgk.com
push dateWed, 14 Aug 2019 22:03:20 +0000
treeherdercomm-central@f354e2beb494 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerspmorris
bugs1568224
Bug 1568224 - remove grid usage from calendar-error-prompt.xul. r=pmorris
calendar/base/content/dialogs/calendar-error-prompt.js
calendar/base/content/dialogs/calendar-error-prompt.xul
calendar/base/jar.mn
new file mode 100644
--- /dev/null
+++ b/calendar/base/content/dialogs/calendar-error-prompt.js
@@ -0,0 +1,22 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+/* exported loadErrorPrompt, toggleDetails */
+
+function loadErrorPrompt() {
+    let args = window.arguments[0].QueryInterface(Ci.nsIDialogParamBlock);
+    document.getElementById("general-text").value = args.GetString(0);
+    document.getElementById("error-code").value = args.GetString(1);
+    document.getElementById("error-description").value = args.GetString(2);
+    window.sizeToContent();
+}
+function toggleDetails() {
+    let options = document.getElementById("details-box");
+    if (options.collapsed) {
+        options.collapsed = false;
+    } else {
+        options.collapsed = true;
+    }
+    window.sizeToContent();
+}
--- a/calendar/base/content/dialogs/calendar-error-prompt.xul
+++ b/calendar/base/content/dialogs/calendar-error-prompt.xul
@@ -19,49 +19,28 @@
         onload="loadErrorPrompt()"
         persist="screenX screenY"
         xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
         width="500"
         xmlns:html="http://www.w3.org/1999/xhtml">
 
     <script src="chrome://global/content/globalOverlay.js"/>
     <script src="chrome://global/content/editMenuOverlay.js"/>
-    <script><![CDATA[
-        function loadErrorPrompt() {
-            var args = window.arguments[0].QueryInterface(Ci.nsIDialogParamBlock);
-            document.getElementById("general-text").value = args.GetString(0);
-            document.getElementById("error-code").value = args.GetString(1);
-            document.getElementById("error-description").value = args.GetString(2);
-            this.sizeToContent();
-        }
-        function toggleDetails() {
-            var grid = document.getElementById("details-grid");
-            if (grid.collapsed)
-                grid.collapsed = false;
-            else
-                grid.collapsed = true;
-            this.sizeToContent();
-        }
-    ]]></script>
+    <script src="chrome://calendar/content/calendar-error-prompt.js"/>
+
     <vbox>
         <html:textarea id="general-text" class="plain" readonly="readonly" rows="3"/>
         <hbox>
             <button id="details-button" label="&calendar.error.detail;" oncommand="toggleDetails()"/>
             <spacer flex="1"/>
         </hbox>
-        <grid id="details-grid" collapsed="true" persist="collapsed">
-            <columns>
-                <column/>
-                <column flex="1"/>
-            </columns>
-            <rows>
-                <row>
-                    <label value="&calendar.error.code;"/>
-                    <label id="error-code" value=""/>
-                </row>
-                <row flex="1">
-                    <label value="&calendar.error.description;" control="error-description"/>
-                    <html:textarea id="error-description" class="plain" readonly="readonly" rows="5"/>
-                </row>
-            </rows>
-        </grid>
+        <vbox id="details-box" collapsed="true" persist="collapsed">
+            <hbox>
+                <label value="&calendar.error.code;"/>
+                <label id="error-code" value=""/>
+            </hbox>
+            <vbox>
+                <label value="&calendar.error.description;" control="error-description"/>
+                <html:textarea id="error-description" class="plain" readonly="readonly" rows="5"/>
+            </vbox>
+        </vbox>
     </vbox>
 </dialog>
--- a/calendar/base/jar.mn
+++ b/calendar/base/jar.mn
@@ -49,16 +49,17 @@ calendar.jar:
     content/calendar-views.js                                   (content/calendar-views.js)
     content/calendar-views.xul                                  (content/calendar-views.xul)
     content/calendar-alarm-dialog.js                            (content/dialogs/calendar-alarm-dialog.js)
     content/calendar-alarm-dialog.xul                           (content/dialogs/calendar-alarm-dialog.xul)
     content/calendar-conflicts-dialog.xul                       (content/dialogs/calendar-conflicts-dialog.xul)
     content/calendar-creation.js                                (content/dialogs/calendar-creation.js)
     content/calendar-dialog-utils.js                            (content/dialogs/calendar-dialog-utils.js)
     content/calendar-error-prompt.xul                           (content/dialogs/calendar-error-prompt.xul)
+    content/calendar-error-prompt.js                            (content/dialogs/calendar-error-prompt.js)
     content/calendar-event-dialog-attendees-custom-elements.js  (content/dialogs/calendar-event-dialog-attendees-custom-elements.js)
     content/calendar-event-dialog-attendees.js                  (content/dialogs/calendar-event-dialog-attendees.js)
     content/calendar-event-dialog-attendees.xul                 (content/dialogs/calendar-event-dialog-attendees.xul)
     content/calendar-event-dialog-recurrence.js                 (content/dialogs/calendar-event-dialog-recurrence.js)
     content/calendar-event-dialog-recurrence.xul                (content/dialogs/calendar-event-dialog-recurrence.xul)
     content/calendar-event-dialog-reminder.js                   (content/dialogs/calendar-event-dialog-reminder.js)
     content/calendar-event-dialog-reminder.xul                  (content/dialogs/calendar-event-dialog-reminder.xul)
     content/calendar-event-dialog-timezone.js                   (content/dialogs/calendar-event-dialog-timezone.js)