Author: sergeyhalipov
Date: 2008-01-22 15:45:05 -0500 (Tue, 22 Jan 2008)
New Revision: 5546
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/css/modalPanel.xcss
trunk/ui/modal-panel/src/main/resources/org/richfaces/renderkit/html/scripts/modalPanel.js
trunk/ui/modal-panel/src/main/templates/org/richfaces/htmlModalPanel.jspx
Log:
http://jira.jboss.com/jira/browse/RF-1947
http://jira.jboss.com/jira/browse/RF-1654
http://jira.jboss.com/jira/browse/RF-1652
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-22
19:00:14 UTC (rev 5545)
+++
trunk/framework/impl/src/main/resources/org/richfaces/renderkit/html/scripts/utils.js 2008-01-22
20:45:05 UTC (rev 5546)
@@ -5,14 +5,6 @@
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-22
19:00:14 UTC (rev 5545)
+++
trunk/ui/modal-panel/src/main/java/org/richfaces/renderkit/ModalPanelRendererBase.java 2008-01-22
20:45:05 UTC (rev 5546)
@@ -166,12 +166,6 @@
result.append("overflow: hidden; ");
- String style = (String)panel.getAttributes().get("style");
- if (null != style && !"".equals(style)) {
- result.append(style).
- append(" ");
-
- }
int minHeight = panel.getMinHeight();
int minWidth = panel.getMinWidth();
if (minWidth > -1) {
Modified:
trunk/ui/modal-panel/src/main/resources/org/richfaces/renderkit/html/css/modalPanel.xcss
===================================================================
---
trunk/ui/modal-panel/src/main/resources/org/richfaces/renderkit/html/css/modalPanel.xcss 2008-01-22
19:00:14 UTC (rev 5545)
+++
trunk/ui/modal-panel/src/main/resources/org/richfaces/renderkit/html/css/modalPanel.xcss 2008-01-22
20:45:05 UTC (rev 5546)
@@ -52,6 +52,11 @@
left: -32000px;
}
+ .rich-mp-content {
+ height: 100%;
+ width: 100%;
+ }
+
</f:verbatim>
<u:selector name=".dr-mpnl-spacer, .dr-mpnl-resizer">
@@ -62,11 +67,13 @@
<f:verbatim>
<![CDATA[
-.dr-mpnl-pnl{
+.dr-mpnl-pnl {
border-width: 1px;
border-style: solid;
padding : 1px;
background-color: inherit;
+ height: 100%;
+ width: 100%;
}
.dr-mpnl-pnl-h{
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-22
19:00:14 UTC (rev 5545)
+++
trunk/ui/modal-panel/src/main/resources/org/richfaces/renderkit/html/scripts/modalPanel.js 2008-01-22
20:45:05 UTC (rev 5546)
@@ -479,8 +479,6 @@
eContentDiv.style.overflow = "";
options.width = -1;
options.height = -1;
- eContentDiv.style.width="100%";
- eContentDiv.style.height="100%";
} else {
if (options.width && options.width == -1)
@@ -489,12 +487,13 @@
options.height = 200;
}
+ var eContentTable = $(this.contentTable);
if (options.width && options.width != -1) {
if (this.minWidth > options.width) {
options.width = this.minWidth;
}
- eContentDiv.style.width = options.width + (/px/.test(options.width) ? '' :
'px');
+ eContentTable.style.width = options.width + (/px/.test(options.width) ? '' :
'px');
}
if (options.height && options.height != -1) {
@@ -502,7 +501,7 @@
options.height = this.minHeight;
}
- eContentDiv.style.height = options.height + (/px/.test(options.height) ? '' :
'px');
+ eContentTable.style.height = options.height + (/px/.test(options.height) ? ''
: 'px');
}
eCdiv.mpSet = true;
@@ -559,7 +558,7 @@
element.style.visibility = "hidden";
Element.show(element);
- this.correctShadowSizeEx(eContentDiv);
+ this.correctShadowSizeEx();
if (options.left) {
var _left;
@@ -706,9 +705,9 @@
var vetoeChange = false;
var newSize;
- var eContentDiv = $(this.contentDiv);
+ var eContentTable = $(this.contentTable);
- newSize = Richfaces.getComputedStyleSize(eContentDiv, "width");
+ newSize = Richfaces.getComputedStyleSize(eContentTable, "width");
var oldSize = newSize;
newSize += diff.deltaWidth || 0;
@@ -744,7 +743,7 @@
cssHash.left = newPos + 'px';
}
- newSize = Richfaces.getComputedStyleSize(eContentDiv, "height");
+ newSize = Richfaces.getComputedStyleSize(eContentTable, "height");
var oldSize = newSize;
newSize += diff.deltaHeight || 0;
@@ -788,8 +787,8 @@
Element.setStyle(eCdiv, cssHash);
- Element.setStyle(eContentDiv, cssHashWH);
- this.correctShadowSizeEx(eContentDiv);
+ Element.setStyle(eContentTable, cssHashWH);
+ this.correctShadowSizeEx();
Object.extend(this.userOptions, cssHash);
Object.extend(this.userOptions, cssHashWH);
@@ -847,14 +846,13 @@
},
correctShadowSize: function(event) {
- var eContentDiv = $(this.contentDiv);
- this.correctShadowSizeEx($(this.contentDiv));
+ this.correctShadowSizeEx();
},
- correctShadowSizeEx: function(eContentDiv) {
+ correctShadowSizeEx: function() {
var eShadowDiv = $(this.shadowDiv);
var eContentTable = $(this.contentTable);
- if (!eContentDiv || !eShadowDiv || !eContentTable) {
+ if (!eShadowDiv || !eContentTable) {
return;
}
var eIframe = $(this.iframe);
@@ -866,14 +864,11 @@
dx = eShadowDiv.offsetWidth-eShadowDiv.clientWidth;
dy = eShadowDiv.offsetHeight-eShadowDiv.clientHeight;
}
- var w = eContentDiv.parentNode.offsetWidth;
- var h = eContentDiv.parentNode.offsetHeight;
+ var w = eContentTable.offsetWidth;
+ var h = eContentTable.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";
Modified: trunk/ui/modal-panel/src/main/templates/org/richfaces/htmlModalPanel.jspx
===================================================================
--- trunk/ui/modal-panel/src/main/templates/org/richfaces/htmlModalPanel.jspx 2008-01-22
19:00:14 UTC (rev 5545)
+++ trunk/ui/modal-panel/src/main/templates/org/richfaces/htmlModalPanel.jspx 2008-01-22
20:45:05 UTC (rev 5546)
@@ -80,7 +80,12 @@
<div id="#{clientId}ShadowDiv" class="dr-mpnl-shadow
rich-mpnl-shadow"
style="#{component.shadowStyle}" >
</div>
- <table id="#{clientId}ContentTable" cellpadding="0"
cellspacing="0" border="0" style="position: absolute; z-index:
2;"><tbody><tr><td class="dr-mpnl-pnl">
+ <table id="#{clientId}ContentTable" cellpadding="0"
cellspacing="0" border="0"
+ style="position: absolute; z-index: 2; width: #{component.minWidth}px; height:
#{component.minHeight}px; #{component.attributes['style']};">
+ <tbody>
+ <tr>
+ <td class="dr-mpnl-pnl">
+
<div id="#{clientId}ContentDiv"
style="#{this:getContentStyle(context, component)}"
class="rich-mp-content">
<a href="#" class="dr-mpnl-pnl-a"
id="#{clientId}FirstHref" >_</a>