Bug 389689 - Have the dialog for nsIContentDispatchChooser use the width property. r=mano, ui-r=beltzner
authorsdwilsh@shawnwilsher.com
Fri, 03 Aug 2007 16:14:25 -0700
changeset 4254 a50406c7b5de3651b648d011eb4e1c19324bc69a
parent 4253 512935e116748d5b675b8a92919da5d52a0ce825
child 4255 7d6f217fcf4711e41163bee74fd6e6d60b5a2363
push id1
push userbsmedberg@mozilla.com
push dateThu, 20 Mar 2008 16:49:24 +0000
treeherdermozilla-central@61007906a1f8 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmano, beltzner
bugs389689
milestone1.9a8pre
Bug 389689 - Have the dialog for nsIContentDispatchChooser use the width property. r=mano, ui-r=beltzner
toolkit/mozapps/handling/content/dialog.js
toolkit/mozapps/handling/content/dialog.xul
toolkit/mozapps/handling/content/handler.css
toolkit/mozapps/handling/content/handling.dtd
--- a/toolkit/mozapps/handling/content/dialog.js
+++ b/toolkit/mozapps/handling/content/dialog.js
@@ -205,20 +205,20 @@ var dialog = {
     this._okButton.disabled = this._itemChoose.selected;
   },
 
  /**
   * Updates the UI based on the checkbox being checked or not.
   */
   onCheck: function onCheck()
   {
-    document.getElementById("remember-text").hidden =
-      !document.getElementById("remember").checked;
-
-    window.sizeToContent();
+    if (document.getElementById("remember").checked)
+      document.getElementById("remember-text").setAttribute("visible", "true");
+    else
+      document.getElementById("remember-text").removeAttribute("visible");
   },
 
   /////////////////////////////////////////////////////////////////////////////
   //// Getters / Setters
 
  /**
   * Returns the selected element in the richlistbox
   */
--- a/toolkit/mozapps/handling/content/dialog.xul
+++ b/toolkit/mozapps/handling/content/dialog.xul
@@ -40,17 +40,18 @@
    - ***** END LICENSE BLOCK ***** -->
 
 <!-- TODO this needs to move to locale/ once we are certain of the strings -->
 <!DOCTYPE dialog SYSTEM "chrome://mozapps/content/handling/handling.dtd">
 
 <dialog id="handling"
         ondialogaccept="return dialog.onAccept();"
         onload="dialog.initialize();"
-        style="width: 320px;"
+        width="&window.width;" height="&window.height;"
+        persist="width height screenX screenY sizemode"
         xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
 
   <script src="chrome://mozapps/content/handling/dialog.js" type="application/javascript"/>
 
   <stringbundleset id="strings">
     <stringbundle id="base-strings"
                   src="chrome://mozapps/content/handling/handling.properties"/>
   </stringbundleset>
@@ -68,11 +69,11 @@
         <label value="&ChooseApp.description;" flex="1"/>
         <button oncommand="dialog.chooseApplication();"
                 label="&ChooseApp.label;" accesskey="&ChooseApp.accessKey;"/>
       </richlistitem>
     </richlistbox>
   </vbox>
 
   <checkbox id="remember" oncommand="dialog.onCheck();"/>
-  <description id="remember-text" hidden="true"/>
+  <description id="remember-text"/>
 
 </dialog>
--- a/toolkit/mozapps/handling/content/handler.css
+++ b/toolkit/mozapps/handling/content/handler.css
@@ -1,3 +1,7 @@
 richlistitem[type="handler"] {
   -moz-binding: url('chrome://mozapps/content/handling/handler.xml#handler');
 }
+
+#remember-text:not([visible]) {
+  visibility: hidden;
+}
--- a/toolkit/mozapps/handling/content/handling.dtd
+++ b/toolkit/mozapps/handling/content/handling.dtd
@@ -1,3 +1,5 @@
+<!ENTITY window.width "320">
+<!ENTITY window.height "250">
 <!ENTITY ChooseApp.description "Choose an Application">
 <!ENTITY ChooseApp.label "Choose...">
 <!ENTITY ChooseApp.accessKey "C">