Bug 541313 Image Properties dialog always reverts to Actual Size. r+a=IanN
authorNeil Rashbrook <neil@parkwaycc.co.uk>
Mon, 11 Jul 2011 15:33:17 +0100
changeset 8287 4ad6cea2a306525c7d4c8da604c72eba160718a3
parent 8286 3f57dc8c8349525c69d52fa63e1d7b636c0c1f48
child 8288 a555dac15d9033b6b2e66343426eb1c9b3447ee7
push id84
push userbugzilla@standard8.plus.com
push dateTue, 16 Aug 2011 21:25:04 +0000
treeherdercomm-beta@6970c86be3cd [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs541313
Bug 541313 Image Properties dialog always reverts to Actual Size. r+a=IanN
editor/ui/dialogs/content/EdImageOverlay.js
editor/ui/dialogs/content/EdImageOverlay.xul
--- a/editor/ui/dialogs/content/EdImageOverlay.js
+++ b/editor/ui/dialogs/content/EdImageOverlay.js
@@ -82,17 +82,16 @@ function ImageStartup()
   gDialog.tabDimensions     = document.getElementById( "imageDimensionsTab" );
   gDialog.tabBorder         = document.getElementById( "imageBorderTab" );
   gDialog.srcInput          = document.getElementById( "srcInput" );
   gDialog.titleInput        = document.getElementById( "titleInput" );
   gDialog.altTextInput      = document.getElementById( "altTextInput" );
   gDialog.altTextRadioGroup = document.getElementById( "altTextRadioGroup" );
   gDialog.altTextRadio      = document.getElementById( "altTextRadio" );
   gDialog.noAltTextRadio    = document.getElementById( "noAltTextRadio" );
-  gDialog.customSizeRadio   = document.getElementById( "customSizeRadio" );
   gDialog.actualSizeRadio   = document.getElementById( "actualSizeRadio" );
   gDialog.constrainCheckbox = document.getElementById( "constrainCheckbox" );
   gDialog.widthInput        = document.getElementById( "widthInput" );
   gDialog.heightInput       = document.getElementById( "heightInput" );
   gDialog.widthUnitsMenulist   = document.getElementById( "widthUnitsMenulist" );
   gDialog.heightUnitsMenulist  = document.getElementById( "heightUnitsMenulist" );
   gDialog.imagelrInput      = document.getElementById( "imageleftrightInput" );
   gDialog.imagetbInput      = document.getElementById( "imagetopbottomInput" );
@@ -216,18 +215,16 @@ function InitImage()
 
 function  SetSizeWidgets(width, height)
 {
   if (!(width || height) || (gActualWidth && gActualHeight && width == gActualWidth && height == gActualHeight))
     gDialog.actualSizeRadio.radioGroup.selectedItem = gDialog.actualSizeRadio;
 
   if (!gDialog.actualSizeRadio.selected)
   {
-    gDialog.actualSizeRadio.radioGroup.selectedItem = gDialog.customSizeRadio;
-
     // Decide if user's sizes are in the same ratio as actual sizes
     if (gActualWidth && gActualHeight)
     {
       if (gActualWidth > gActualHeight)
         gDialog.constrainCheckbox.checked = (Math.round(gActualHeight * width / gActualWidth) == height);
       else
         gDialog.constrainCheckbox.checked = (Math.round(gActualWidth * height / gActualHeight) == width);
     }
@@ -400,18 +397,18 @@ function ChangeImageSrc()
   gTimerID = setTimeout(LoadPreviewImage, 800);
 
   SetRelativeCheckbox();
   doOverallEnabling();
 }
 
 function doDimensionEnabling()
 {
-  // Enabled only if "Custom" is selected
-  var enable = (gDialog.customSizeRadio.selected);
+  // Enabled unless "Actual Size" is selected
+  var enable = !gDialog.actualSizeRadio.selected;
 
   // BUG 74145: After input field is disabled,
   //   setting it enabled causes blinking caret to appear
   //   even though focus isn't set to it.
   SetElementEnabledById( "heightInput", enable );
   SetElementEnabledById( "heightLabel", enable );
   SetElementEnabledById( "heightUnitsMenulist", enable );
 
--- a/editor/ui/dialogs/content/EdImageOverlay.xul
+++ b/editor/ui/dialogs/content/EdImageOverlay.xul
@@ -144,16 +144,17 @@
           id      = "actualSizeRadio" 
           label   = "&actualSizeRadio.label;"
           accesskey = "&actualSizeRadio.accessKey;"
           tooltiptext="&actualSizeRadio.tooltip;"
           oncommand = "SetActualSize()"/>
         <radio
           id      = "customSizeRadio" 
           label   = "&customSizeRadio.label;"
+          selected = "true"
           accesskey = "&customSizeRadio.accessKey;"
           tooltiptext="&customSizeRadio.tooltip;"
           oncommand = "doDimensionEnabling();" />
       </radiogroup>
       <spacer flex="1"/>
       <vbox>
         <spacer flex="1"/>
         <checkbox id="constrainCheckbox" label="&constrainCheckbox.label;"