Author: nbelaevski
Date: 2007-12-12 20:01:04 -0500 (Wed, 12 Dec 2007)
New Revision: 4800
Modified:
branches/3.1.x/ui/orderingList/src/main/resources/org/richfaces/renderkit/html/css/orderingList.xcss
branches/3.1.x/ui/orderingList/src/main/resources/org/richfaces/renderkit/html/scripts/LayoutManager.js
branches/3.1.x/ui/orderingList/src/main/templates/org/richfaces/htmlOrderingList.jspx
branches/3.1.x/ui/orderingList/src/test/java/org/richfaces/renderkit/OrderingListRenderingTest.java
Log:
http://jira.jboss.com/jira/browse/RF-1611
Modified:
branches/3.1.x/ui/orderingList/src/main/resources/org/richfaces/renderkit/html/css/orderingList.xcss
===================================================================
---
branches/3.1.x/ui/orderingList/src/main/resources/org/richfaces/renderkit/html/css/orderingList.xcss 2007-12-13
01:00:56 UTC (rev 4799)
+++
branches/3.1.x/ui/orderingList/src/main/resources/org/richfaces/renderkit/html/css/orderingList.xcss 2007-12-13
01:01:04 UTC (rev 4800)
@@ -119,7 +119,6 @@
}
.rich-ordering-list-items {
- background : repeat scroll left top;
width: 100%;
}
@@ -143,19 +142,15 @@
width: 100%;
}
-.rich-ordering-list-table-header-cell {
- background : none top left repeat-x;
- border-style: none solid solid none;
- padding : 2px;
- font-weight: normal;
-}
-
-.rich-ordering-list-table-header-cell-last {
- border-style: none solid solid none;
- border-right: 0;
+.rich-ordering-list-table-header-cell, .rich-ordering-list-table-header-cell-last {
white-space: nowrap;
- font-weight: normal;
background-repeat: repeat-x;
+ border-style: solid;
+ padding : 2px;
+ font-weight: normal;
+
+ border-top: 0px;
+ border-left: 0px;
}
.rich-ordering-list-cell {
@@ -229,10 +224,6 @@
<u:style name="color" skin="generalTextColor"/>
</u:selector>
- <u:selector name=".rich-ordering-list-table-header-cell">
- <u:style name="border-right-color" skin="tableBorderColor"
/>
- </u:selector>
-
<u:selector name=".rich-ordering-list-table-header-cell,
.rich-ordering-list-table-header-cell-last">
<u:style name="background-image">
<f:resource
f:key="org.richfaces.renderkit.html.gradientimages.OrderingListHeaderGradient"
/>
@@ -241,15 +232,18 @@
<u:style name="color" skin="generalTextColor" />
<u:style name="font-family" skin="headerFamilyFont" />
<u:style name="font-size" skin="headerSizeFont" />
- <u:style name="border-width" skin="tableBorderWidth" />
+
+ <u:style name="border-right-width" skin="tableBorderWidth"
/>
+ <u:style name="border-bottom-width" skin="tableBorderWidth"
/>
+
+ <u:style name="border-right-color" skin="tableBorderColor"
/>
<u:style name="border-bottom-color" skin="tableBorderColor"
/>
- <u:style name="border-left-color" skin="tableBorderColor" />
</u:selector>
- <u:selector name=".rich-ordering-list-items">
- <u:style name="border-color" skin="tableBorderColor" />
+ <u:selector name=".rich-ordering-list-table-header-cell-last">
+ <u:style name="border-right-width" value="0px" />
</u:selector>
-
+
<u:selector name=".rich-ordering-list-output">
<u:style name="background-color" skin="tableBackgroundColor"
/>
<u:style name="border-color" skin="tableBorderColor" />
Modified:
branches/3.1.x/ui/orderingList/src/main/resources/org/richfaces/renderkit/html/scripts/LayoutManager.js
===================================================================
---
branches/3.1.x/ui/orderingList/src/main/resources/org/richfaces/renderkit/html/scripts/LayoutManager.js 2007-12-13
01:00:56 UTC (rev 4799)
+++
branches/3.1.x/ui/orderingList/src/main/resources/org/richfaces/renderkit/html/scripts/LayoutManager.js 2007-12-13
01:01:04 UTC (rev 4800)
@@ -78,6 +78,28 @@
}
LayoutManager.calculateWidth = function(srcElem, tgtElem) {
+// Hasn't passed testing :(
+//
+// tgtElem.style.width = "1px";
+// tgtElem.firstChild.style.width = "1px";
+// var tgtStyleWidth = 1;//Richfaces.getComputedStyleSize(tgtElem, "width");
+// //var srcStyleWidth = Richfaces.getComputedStyleSize(srcElem, "width");
+//
+// var srcElemBorderWidth = LayoutManager.getBorderWidth(srcElem, "lr");
+// var srcElemPaddingWidth = LayoutManager.getPaddingWidth(srcElem, "lr");
+// var srcElemMarginWidth = LayoutManager.getMarginWidth(srcElem, "lr");
+//
+// var tgtElemBorderWidth = LayoutManager.getBorderWidth(tgtElem, "lr");
+// var tgtElemPaddingWidth = LayoutManager.getPaddingWidth(tgtElem, "lr");
+// var tgtElemMarginWidth = LayoutManager.getMarginWidth(tgtElem, "lr");
+//
+// var w = (srcElem.clientWidth - tgtElem.clientWidth +
+// srcElemBorderWidth - tgtElemBorderWidth +
+// + tgtStyleWidth);
+//
+// w = (w > 0) ? w : 0;
+// return {colWidth: w};
+
var srcElemBorderWidth = LayoutManager.getBorderWidth(srcElem, "lr");
var srcElemPaddingWidth = LayoutManager.getPaddingWidth(srcElem, "lr");
var srcElemMarginWidth = LayoutManager.getMarginWidth(srcElem, "lr");
@@ -109,13 +131,13 @@
var val = 0;
for(var i = 0, len = sides.length; i < len; i++){
//if (el.getStyle) {
- var w = parseInt(Element.getStyle(el, styles[sides.charAt(i)]), 10);
+ var w = parseInt(Richfaces.getComputedStyleSize(el, styles[sides.charAt(i)]), 10);
if(!isNaN(w)) val += w;
//}
}
return val;
}
-LayoutManager.borders = {l: 'border-left-width', r: 'border-right-width',
t: 'border-top-width', b: 'border-bottom-width'},
-LayoutManager.paddings = {l: 'padding-left', r: 'padding-right', t:
'padding-top', b: 'padding-bottom'},
-LayoutManager.margins = {l: 'margin-left', r: 'margin-right', t:
'margin-top', b: 'margin-bottom'}
+LayoutManager.borders = {l: 'borderLeftWidth', r: 'borderRightWidth', t:
'borderTopWidth', b: 'borderBottomWidth'},
+LayoutManager.paddings = {l: 'paddingLeft', r: 'paddingRight', t:
'paddingTop', b: 'paddingBottom'},
+LayoutManager.margins = {l: 'marginLeft', r: 'marginRight', t:
'marginTop', b: 'marginBottom'}
Modified:
branches/3.1.x/ui/orderingList/src/main/templates/org/richfaces/htmlOrderingList.jspx
===================================================================
---
branches/3.1.x/ui/orderingList/src/main/templates/org/richfaces/htmlOrderingList.jspx 2007-12-13
01:00:56 UTC (rev 4799)
+++
branches/3.1.x/ui/orderingList/src/main/templates/org/richfaces/htmlOrderingList.jspx 2007-12-13
01:01:04 UTC (rev 4800)
@@ -19,6 +19,7 @@
new org.ajax4jsf.javascript.PrototypeScript(),
scripts/ShuttleUtils.js,
scripts/SelectItem.js,
+ /org/richfaces/renderkit/html/scripts/utils.js,
scripts/LayoutManager.js
scripts/Control.js,
scripts/ListBase.js,
@@ -51,7 +52,7 @@
if (isHeaderExists(context, component)) {
]]></jsp:scriptlet>
<div class="rich-ordering-list-header"
style="#{contentContainerStyle}">
- <table id="#{clientId}internal_header_tab"
class="rich-ordering-list-items" cellpadding="0"
cellspacing="0">
+ <table id="#{clientId}internal_header_tab"
class="rich-ordering-list-items-header" cellpadding="0"
cellspacing="0">
<f:call name="encodeHeader"/>
</table>
</div>
Modified:
branches/3.1.x/ui/orderingList/src/test/java/org/richfaces/renderkit/OrderingListRenderingTest.java
===================================================================
---
branches/3.1.x/ui/orderingList/src/test/java/org/richfaces/renderkit/OrderingListRenderingTest.java 2007-12-13
01:00:56 UTC (rev 4799)
+++
branches/3.1.x/ui/orderingList/src/test/java/org/richfaces/renderkit/OrderingListRenderingTest.java 2007-12-13
01:01:04 UTC (rev 4800)
@@ -58,6 +58,7 @@
javaScripts.add("org.ajax4jsf.javascript.PrototypeScript");
javaScripts.add("scripts/ShuttleUtils.js");
javaScripts.add("scripts/SelectItem.js");
+ javaScripts.add("org/richfaces/renderkit/html/scripts/utils.js");
javaScripts.add("scripts/LayoutManager.js");
javaScripts.add("scripts/Control.js");
javaScripts.add("scripts/OrderingList.js");