Bug 1495958 - Fix labels without controls to avoid TypeError in text.xml; r=mkmelin, MakeMyDay
authorGeoff Lankow <geoff@darktrojan.net>
Thu, 04 Oct 2018 20:17:02 +1300
changeset 33296 c2608a685d0082508f8a32c8f3c4f14737285214
parent 33295 028f53e3c744d5f31e5892cf205a427d0044827d
child 33297 37c79adc0b983e12a3bec6f6832607372e1f3ca7
push id387
push userclokep@gmail.com
push dateMon, 10 Dec 2018 21:30:47 +0000
reviewersmkmelin, MakeMyDay
bugs1495958
Bug 1495958 - Fix labels without controls to avoid TypeError in text.xml; r=mkmelin, MakeMyDay
calendar/base/content/calendar-unifinder-todo.xul
mail/base/content/msgHdrView.inc
--- a/calendar/base/content/calendar-unifinder-todo.xul
+++ b/calendar/base/content/calendar-unifinder-todo.xul
@@ -12,32 +12,36 @@
 
 <overlay xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
 
   <script type="application/javascript" src="chrome://calendar/content/calendar-task-tree.js"/>
   <script type="application/javascript" src="chrome://calendar/content/calFilter.js"/>  <script type="application/javascript" src="chrome://calendar/content/calendar-unifinder-todo.js"/>
   <script type="application/javascript" src="chrome://global/content/globalOverlay.js"/>
 
   <vbox id="todo-tab-panel" persist="height,collapsed" flex="1">
-    <box id="todo-label" align="left" collapsed="true">
-      <label flex="1" crop="end" style="font-weight: bold" value="&calendar.unifinder.todoitems.label;" control="unifinder-todo-tree"/>
-    </box>
-    <box align="center">
-      <checkbox id="show-completed-checkbox"
-                label="&calendar.unifinder.showcompletedtodos.label;"
-                flex="1"
-                crop="end"
-                oncommand="updateCalendarToDoUnifinder()"
-                persist="checked"/>
-    </box>
-    <vbox id="calendar-task-tree-detail" flex="1">
-      <calendar-task-tree id="unifinder-todo-tree" flex="1"
-                          visible-columns="completed priority title"
-                          persist="visible-columns ordinals widths sort-active sort-direction"
-                          context="taskitem-context-menu"/>
-      <textbox id="unifinder-task-edit-field"
-               class="task-edit-field"
-               onfocus="taskEdit.onFocus(event)"
-               onblur="taskEdit.onBlur(event)"
-               onkeypress="taskEdit.onKeyPress(event)"/>
+    <!-- This second vbox means all of this is added to the DOM at once,
+         so the label's binding doesn't complain about not having a control. -->
+    <vbox flex="1">
+      <box id="todo-label" align="left" collapsed="true">
+        <label flex="1" crop="end" style="font-weight: bold" value="&calendar.unifinder.todoitems.label;" control="unifinder-todo-tree"/>
+      </box>
+      <box align="center">
+        <checkbox id="show-completed-checkbox"
+                  label="&calendar.unifinder.showcompletedtodos.label;"
+                  flex="1"
+                  crop="end"
+                  oncommand="updateCalendarToDoUnifinder()"
+                  persist="checked"/>
+      </box>
+      <vbox id="calendar-task-tree-detail" flex="1">
+        <calendar-task-tree id="unifinder-todo-tree" flex="1"
+                            visible-columns="completed priority title"
+                            persist="visible-columns ordinals widths sort-active sort-direction"
+                            context="taskitem-context-menu"/>
+        <textbox id="unifinder-task-edit-field"
+                 class="task-edit-field"
+                 onfocus="taskEdit.onFocus(event)"
+                 onblur="taskEdit.onBlur(event)"
+                 onkeypress="taskEdit.onKeyPress(event)"/>
+      </vbox>
     </vbox>
   </vbox>
 </overlay>
--- a/mail/base/content/msgHdrView.inc
+++ b/mail/base/content/msgHdrView.inc
@@ -366,17 +366,17 @@
                                       <label id="expandedin-reply-toLabel" class="headerName"
                                              value="&inReplyToField4.label;"
                                              control="expandedin-reply-toBox"/>
                                       <mail-messageids-headerfield id="expandedin-reply-toBox"/>
                                     </row>
                                     <row id="expandedreferencesRow" collapsed="true">
                                       <label id="expandedreferencesLabel" class="headerName"
                                              value="&referencesField4.label;"
-                                             control="expandedReferencesBox"/>
+                                             control="expandedreferencesBox"/>
                                       <mail-messageids-headerfield id="expandedreferencesBox"
                                                                    flex="1"/>
                                     </row>
                                     <row id="expandedtagsRow" collapsed="true">
                                       <label id="expandedtagsLabel" class="headerName"
                                              value="&tagsHdr4.label;" control="expandedtagsBox"/>
                                       <mail-tagfield id="expandedtagsBox"/>
                                     </row>