Author: nbelaevski
Date: 2007-03-17 13:22:29 -0400 (Sat, 17 Mar 2007)
New Revision: 96
Modified:
trunk/richfaces/modal-panel/src/main/resources/org/richfaces/renderkit/html/scripts/modalPanel.js
trunk/richfaces/modal-panel/src/main/resources/org/richfaces/renderkit/html/scripts/modalPanelBorders.js
trunk/richfaces/modal-panel/src/main/templates/org/richfaces/htmlModalPanel.jspx
Log:
Vertical resize fixed in IE6
Modified:
trunk/richfaces/modal-panel/src/main/resources/org/richfaces/renderkit/html/scripts/modalPanel.js
===================================================================
---
trunk/richfaces/modal-panel/src/main/resources/org/richfaces/renderkit/html/scripts/modalPanel.js 2007-03-17
14:15:26 UTC (rev 95)
+++
trunk/richfaces/modal-panel/src/main/resources/org/richfaces/renderkit/html/scripts/modalPanel.js 2007-03-17
17:22:29 UTC (rev 96)
@@ -57,7 +57,7 @@
ModalPanel.Context = Class.create();
ModalPanel.Context.prototype = {
initialize: function(modalPanel) {
- this.cdiv = modalPanel.cdiv;
+ this.cdiv = modalPanel.contentDiv;
this.isPositionFixed = Richfaces.getComputedStyle(this.cdiv, "position") ==
"fixed";
},
@@ -106,7 +106,8 @@
this.div = $(id + "Div");
this.cursorDiv = $(id + "CursorDiv");
this.cdiv = $(id + "CDiv");
-
+ this.contentDiv = $(id + "ContentDiv");
+
this.context = new ModalPanel.Context(this);
this.borders = new Array();
@@ -282,7 +283,7 @@
options.width = this.minWidth;
}
- this.cdiv.style.width = options.width + 'px';
+ this.contentDiv.style.width = options.width + 'px';
}
if (options.height) {
@@ -290,7 +291,7 @@
options.height = this.minHeight;
}
- this.cdiv.style.height = options.height + 'px';
+ this.contentDiv.style.height = options.height + 'px';
}
if (options.left) {
@@ -300,9 +301,9 @@
} else {
var cw = getSizeElement().clientWidth;
if (RichFaces.navigatorType() == "OPERA")
- _left = (cw - this.cdiv.style.width.replace("px", "")) / 2;
+ _left = (cw - this.contentDiv.style.width.replace("px", "")) /
2;
else
- _left = (cw - Richfaces.getComputedStyleSize(this.cdiv, "width")) / 2;
+ _left = (cw - Richfaces.getComputedStyleSize(this.contentDiv, "width")) /
2;
}
@@ -315,7 +316,7 @@
_top = parseInt(options.top, 10);
} else {
var cw = getSizeElement().clientHeight;
- _top = (cw - Richfaces.getComputedStyleSize(this.cdiv, "height")) / 2;
+ _top = (cw - Richfaces.getComputedStyleSize(this.contentDiv, "height")) /
2;
}
this.setTop(_top);
@@ -377,6 +378,8 @@
Element.show(this.id);
+ this.doResizeOrMove(ModalPanel.Sizer.Diff.EMPTY);
+
for (var k = 0; k < this.borders.length; k++ ) {
this.borders[k].doPosition();
}
@@ -427,25 +430,24 @@
doResizeOrMove: function(diff) {
var vetoes = {};
var cssHash = {};
+ var cssHashWH = {};
var winSize = Richfaces.getWindowSize();
var vetoeChange = false;
- var newSize = Richfaces.getComputedStyleSize(this.cdiv, "width");
+ var newSize = Richfaces.getComputedStyleSize(this.contentDiv, "width");
var oldSize = newSize;
- var maxX = winSize.width - oldSize - 1;
newSize += diff.deltaWidth || 0;
if (newSize >= this.minWidth) {
if (diff.deltaWidth) {
- cssHash.width = newSize + 'px';
+ cssHashWH.width = newSize + 'px';
maxX = winSize.width - newSize -1;
}
} else {
if (diff.deltaWidth) {
- cssHash.width = this.minWidth + 'px';
- maxX = winSize.width - this.minWidth -1;
+ cssHashWH.width = this.minWidth + 'px';
vetoes.vx = oldSize - this.minWidth;
}
@@ -465,34 +467,26 @@
if (this.cdiv.mpUseExpr) {
newPos = this.cdiv.mpLeft || 0;
newPos += diff.deltaX;
- if (newPos<0) newPos = 0;
- if (newPos>maxX) newPos = maxX;
this.cdiv.mpLeft = newPos;
} else {
newPos = Richfaces.getComputedStyleSize(this.cdiv, "left");
newPos += diff.deltaX;
- if (newPos<0) newPos = 0;
- if (newPos>maxX) newPos = maxX;
-
cssHash.left = newPos + 'px';
}
}
- var newSize = Richfaces.getComputedStyleSize(this.cdiv, "height");
+ var newSize = Richfaces.getComputedStyleSize(this.contentDiv, "height");
var oldSize = newSize;
- var maxY = winSize.height - oldSize - 1;
newSize += diff.deltaHeight || 0;
if (newSize >= this.minHeight) {
if (diff.deltaHeight) {
- cssHash.height = newSize + 'px';
- maxY = winSize.height - newSize -1;
+ cssHashWH.height = newSize + 'px';
}
} else {
if (diff.deltaHeight) {
- cssHash.height = this.minHeight + 'px';
- maxY = winSize.heigth - this.minHeight -1;
+ cssHashWH.height = this.minHeight + 'px';
vetoes.vy = oldSize - this.minHeight;
}
@@ -513,24 +507,20 @@
if (this.cdiv.mpUseExpr) {
newPos = this.cdiv.mpTop || 0;
newPos += diff.deltaY;
- if (newPos<0) newPos = 0;
- if (newPos>maxY) newPos = maxY;
this.cdiv.mpTop = newPos;
} else {
newPos = Richfaces.getComputedStyleSize(this.cdiv, "top");
newPos += diff.deltaY;
- if (newPos<0) newPos = 0;
- if (newPos>maxY) newPos = maxY;
-
cssHash.top = newPos + 'px';
}
}
Element.setStyle(this.cdiv, cssHash);
+ Element.setStyle(this.contentDiv, cssHashWH);
- var w = this.cdiv.offsetWidth;
- var h = this.cdiv.offsetHeight;
+ var w = this.context.width();
+ var h = this.context.height();
this.context.reduced = null;
Modified:
trunk/richfaces/modal-panel/src/main/resources/org/richfaces/renderkit/html/scripts/modalPanelBorders.js
===================================================================
---
trunk/richfaces/modal-panel/src/main/resources/org/richfaces/renderkit/html/scripts/modalPanelBorders.js 2007-03-17
14:15:26 UTC (rev 95)
+++
trunk/richfaces/modal-panel/src/main/resources/org/richfaces/renderkit/html/scripts/modalPanelBorders.js 2007-03-17
17:22:29 UTC (rev 96)
@@ -116,7 +116,7 @@
this.modalPanel.endDrag(this);
- vetoes = this.modalPanel.doResizeOrMove(ModalPanel.Sizer.Diff.EMPTY);
+ this.modalPanel.doResizeOrMove(ModalPanel.Sizer.Diff.EMPTY);
this.modalPanel.cursorDiv.style.zIndex = -200;
},
Modified:
trunk/richfaces/modal-panel/src/main/templates/org/richfaces/htmlModalPanel.jspx
===================================================================
---
trunk/richfaces/modal-panel/src/main/templates/org/richfaces/htmlModalPanel.jspx 2007-03-17
14:15:26 UTC (rev 95)
+++
trunk/richfaces/modal-panel/src/main/templates/org/richfaces/htmlModalPanel.jspx 2007-03-17
17:22:29 UTC (rev 96)
@@ -41,7 +41,7 @@
<div class="dr-mpnl-mask-div rich-mpnl-mask-div"
id="#{clientId}CursorDiv"
style="filter: alpha(opacity=1); opacity: 0.01; z-index:
-200"></div>
- <div id="#{clientId}CDiv" class="dr-mpnl-panel rich-mpnl_panel"
style="z-index: 2;">
+ <div id="#{clientId}CDiv" class="dr-mpnl-panel rich-mpnl_panel"
style="width: 1px; height: 1px; z-index: 2;">
<jsp:scriptlet>
<![CDATA[
@@ -66,8 +66,8 @@
]]>
</jsp:scriptlet>
- <div style="position: absolute; width: 100%; height: 100%; overflow: hidden;
z-index: 2;"
- class="dr-mpnl-pnl" >
+ <div style="position: absolute; overflow: hidden; z-index: 2;"
+ class="dr-mpnl-pnl" id="#{clientId}ContentDiv">
<table style="height: 100%; width: 100%;" border="0"
cellpadding="0" cellspacing="0">
<jsp:scriptlet>
<![CDATA[if(component.getFacet("header")!=null &&
component.getFacet("header").isRendered()) {]]>