Author: sergeyhalipov
Date: 2008-01-08 15:23:59 -0500 (Tue, 08 Jan 2008)
New Revision: 5203
Modified:
trunk/framework/impl/src/main/resources/org/richfaces/renderkit/html/scripts/utils.js
trunk/ui/modal-panel/src/main/java/org/richfaces/renderkit/ModalPanelRendererBase.java
trunk/ui/modal-panel/src/main/resources/org/richfaces/renderkit/html/scripts/modalPanel.js
Log:
http://jira.jboss.com/jira/browse/RF-1654
Modified:
trunk/framework/impl/src/main/resources/org/richfaces/renderkit/html/scripts/utils.js
===================================================================
---
trunk/framework/impl/src/main/resources/org/richfaces/renderkit/html/scripts/utils.js 2008-01-08
19:10:56 UTC (rev 5202)
+++
trunk/framework/impl/src/main/resources/org/richfaces/renderkit/html/scripts/utils.js 2008-01-08
20:23:59 UTC (rev 5203)
@@ -4,6 +4,15 @@
Richfaces.getComputedStyle = function(eltId, propertyName) {
var elt = $(eltId);
+
+ // Fix situation when width or height are set in percentage.
+ if ('width' == propertyName) {
+ return (elt.clientWidth || elt.offsetWidth) + "px";
+ }
+ if ('height' == propertyName) {
+ return (elt.clientHeight || elt.offsetHeight) + "px";
+ }
+
if (elt.currentStyle) {
return elt.currentStyle[propertyName];
}
Modified:
trunk/ui/modal-panel/src/main/java/org/richfaces/renderkit/ModalPanelRendererBase.java
===================================================================
---
trunk/ui/modal-panel/src/main/java/org/richfaces/renderkit/ModalPanelRendererBase.java 2008-01-08
19:10:56 UTC (rev 5202)
+++
trunk/ui/modal-panel/src/main/java/org/richfaces/renderkit/ModalPanelRendererBase.java 2008-01-08
20:23:59 UTC (rev 5203)
@@ -175,10 +175,10 @@
int minHeight = panel.getMinHeight();
int minWidth = panel.getMinWidth();
if (minWidth > -1) {
- result.append("min-width: " + minWidth + "; ");
+ result.append("min-width: " + minWidth + "px; ");
}
if (minHeight > -1) {
- result.append("min-height: " + minHeight + "; ");
+ result.append("min-height: " + minHeight + "px; ");
}
return result.toString();
Modified:
trunk/ui/modal-panel/src/main/resources/org/richfaces/renderkit/html/scripts/modalPanel.js
===================================================================
---
trunk/ui/modal-panel/src/main/resources/org/richfaces/renderkit/html/scripts/modalPanel.js 2008-01-08
19:10:56 UTC (rev 5202)
+++
trunk/ui/modal-panel/src/main/resources/org/richfaces/renderkit/html/scripts/modalPanel.js 2008-01-08
20:23:59 UTC (rev 5203)
@@ -869,6 +869,7 @@
correctShadowSizeEx: function(eContentDiv) {
var eShadowDiv = $(this.shadowDiv);
+ var eContentTable = $(this.contentTable);
var eIframe = $(this.iframe);
var dx = 0;
@@ -882,6 +883,10 @@
var h = eContentDiv.parentNode.offsetHeight;
eShadowDiv.style.width = (w-dx)+"px";
eShadowDiv.style.height = (h-dy)+"px";
+
+ eContentTable.style.width = w + "px";
+ eContentTable.style.height = h + "px";
+
if (eIframe) {
eIframe.style.width = w+"px";
eIframe.style.height = h+"px";