[seam-commits] Seam SVN: r11437 - in sandbox/trunk/modules/xwidgets: src/main/javascript and 1 other directory.

seam-commits at lists.jboss.org seam-commits at lists.jboss.org
Thu Aug 27 08:35:45 EDT 2009


Author: shane.bryzak at jboss.com
Date: 2009-08-27 08:35:44 -0400 (Thu, 27 Aug 2009)
New Revision: 11437

Modified:
   sandbox/trunk/modules/xwidgets/examples/panels/index.html
   sandbox/trunk/modules/xwidgets/examples/panels/panels.xw
   sandbox/trunk/modules/xwidgets/src/main/javascript/xw.js
Log:
fixed display issues in safari


Modified: sandbox/trunk/modules/xwidgets/examples/panels/index.html
===================================================================
--- sandbox/trunk/modules/xwidgets/examples/panels/index.html	2009-08-26 23:29:17 UTC (rev 11436)
+++ sandbox/trunk/modules/xwidgets/examples/panels/index.html	2009-08-27 12:35:44 UTC (rev 11437)
@@ -1,6 +1,6 @@
 <html>
   <body style="background-color:#eeeeee">
-    <h1>Panel Examples</h1>
+    <h1>Panel Example</h1>
   
     <div id="container" style="border:1px solid black;width:75%;height:75%"></div>
     

Modified: sandbox/trunk/modules/xwidgets/examples/panels/panels.xw
===================================================================
--- sandbox/trunk/modules/xwidgets/examples/panels/panels.xw	2009-08-26 23:29:17 UTC (rev 11436)
+++ sandbox/trunk/modules/xwidgets/examples/panels/panels.xw	2009-08-27 12:35:44 UTC (rev 11437)
@@ -15,7 +15,7 @@
   <panel align="right" width="50">
     <label value="right"/>
   </panel>    
-
+
   <panel align="client">
     <label value="client"/>  
   </panel>

Modified: sandbox/trunk/modules/xwidgets/src/main/javascript/xw.js
===================================================================
--- sandbox/trunk/modules/xwidgets/src/main/javascript/xw.js	2009-08-26 23:29:17 UTC (rev 11436)
+++ sandbox/trunk/modules/xwidgets/src/main/javascript/xw.js	2009-08-27 12:35:44 UTC (rev 11437)
@@ -133,6 +133,36 @@
 	return strValue;
 }
 
+xw.Sys.getBorder = function(control)
+{
+  var border = {};
+  if (window.navigator.userAgent.indexOf('Safari') == -1)
+  {
+    if (control.currentStyle)
+    {
+      border.top = parseInt(control.currentStyle.borderTopWidth);
+      border.right = parseInt(control.currentStyle.borderRightWidth);
+      border.bottom = parseInt(control.currentStyle.borderBottomWidth);
+      border.left = parseInt(control.currentStyle.borderLeftWidth);
+    } 
+    else 
+    {
+      border.top = parseInt(getComputedStyle(control,null).getPropertyValue('border-top-width'));
+      border.right = parseInt(getComputedStyle(control,null).getPropertyValue('border-right-width'));
+      border.bottom = parseInt(getComputedStyle(control,null).getPropertyValue('border-bottom-width'));
+      border.left = parseInt(getComputedStyle(control,null).getPropertyValue('border-left-width'));
+    }
+  } 
+  else 
+  {
+    border.top = parseInt(control.style.getPropertyValue('border-top-width'));
+    border.right = parseInt(control.style.getPropertyValue('border-right-width'));
+    border.bottom = parseInt(control.style.getPropertyValue('border-bottom-width'));
+    border.left = parseInt(control.style.getPropertyValue('border-left-width'));
+  }
+  return border;
+}
+
 /**
  * A Map implementation
  */
@@ -526,14 +556,10 @@
     
     for (var i in this.style) control.style[i] = this.style[i];              
   
-    var hWidth = parseInt(xw.Sys.getStyle(control, "border-left-width")) +
-      parseInt(xw.Sys.getStyle(control, "border-right-width"));
-    var vWidth = parseInt(xw.Sys.getStyle(control, "border-top-width")) +
-      parseInt(xw.Sys.getStyle(control, "border-bottom-width"));
+    var b = xw.Sys.getBorder(control);
    
-    if (this.height != null) control.style.height = this.height - vWidth;
-    if (this.width != null) control.style.width = this.width - hWidth;
-
+    if (this.height != null) control.style.height = (this.height - b.top - b.bottom) + "px";
+    if (this.width != null) control.style.width = (this.width - b.left - b.right) + "px";
   }
 }
 



More information about the seam-commits mailing list