You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by we...@apache.org on 2014/12/16 19:14:16 UTC

svn commit: r1646035 - in /myfaces/tobago/trunk: tobago-core/src/main/java/org/apache/myfaces/tobago/internal/component/ tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/ tobago-theme/tobag...

Author: weber
Date: Tue Dec 16 18:14:16 2014
New Revision: 1646035

URL: http://svn.apache.org/r1646035
Log:
TOBAGO-1423 - Sheet: forceVerticalScrollbar="true" breaks column alignment

Modified:
    myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/component/AbstractUISheetLayout.java
    myfaces/tobago/trunk/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/SheetRenderer.java
    myfaces/tobago/trunk/tobago-theme/tobago-theme-standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago-sheet.js

Modified: myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/component/AbstractUISheetLayout.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/component/AbstractUISheetLayout.java?rev=1646035&r1=1646034&r2=1646035&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/component/AbstractUISheetLayout.java (original)
+++ myfaces/tobago/trunk/tobago-core/src/main/java/org/apache/myfaces/tobago/internal/component/AbstractUISheetLayout.java Tue Dec 16 18:14:16 2014
@@ -281,7 +281,11 @@ public abstract class AbstractUISheetLay
       }
 
       if (needVerticalScrollbar) {
-        currentWidthList.add(Math.max(freeWidth, verticalScrollbarWeight.getPixel())); // filler column
+        if (freeWidth > 0) {
+          currentWidthList.add(freeWidth + verticalScrollbarWeight.getPixel()); // filler column
+        } else {
+          currentWidthList.add(verticalScrollbarWeight.getPixel()); // filler column
+        }
       } else {
         currentWidthList.add(Math.max(freeWidth, 0)); // empty filler column
       }

Modified: myfaces/tobago/trunk/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/SheetRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/SheetRenderer.java?rev=1646035&r1=1646034&r2=1646035&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/SheetRenderer.java (original)
+++ myfaces/tobago/trunk/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/SheetRenderer.java Tue Dec 16 18:14:16 2014
@@ -789,11 +789,7 @@ public class SheetRenderer extends Layou
       writer.startElement(HtmlElements.COLGROUP, null);
       for (int i = 0; i < columnWidths.size(); i++) {
         writer.startElement(HtmlElements.COL, null);
-        if (needVerticalScrollbar && i == columnWidths.size() - 1) {
-          writer.writeAttribute(HtmlAttributes.WIDTH, columnWidths.get(i) + verticalScrollbarWidth);
-        } else {
-          writer.writeAttribute(HtmlAttributes.WIDTH, columnWidths.get(i));
-        }
+        writer.writeAttribute(HtmlAttributes.WIDTH, columnWidths.get(i));
         writer.endElement(HtmlElements.COL);
       }
       writer.endElement(HtmlElements.COLGROUP);

Modified: myfaces/tobago/trunk/tobago-theme/tobago-theme-standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago-sheet.js
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-theme/tobago-theme-standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago-sheet.js?rev=1646035&r1=1646034&r2=1646035&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-theme/tobago-theme-standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago-sheet.js (original)
+++ myfaces/tobago/trunk/tobago-theme/tobago-theme-standard/src/main/resources/org/apache/myfaces/tobago/renderkit/html/standard/standard/script/tobago-sheet.js Tue Dec 16 18:14:16 2014
@@ -382,24 +382,24 @@ Tobago.Sheet.setup2 = function (sheets)
           }
         }
 
+        var headerFillerWidth = 0;
+        var bodyFillerWidth = 0;
         if (usedWidth <= bodyDivWidth) {
-          var fillerWidth = bodyDivWidth - usedWidth;
-          console.log("SET fillerWidth : " + fillerWidth); // @DEV_ONLY
-          widths = widths + fillerWidth + ",";
-          headerCols.last().attr("width", fillerWidth + verticalScrollbarWidth);
-          bodyCols.last().attr("width", fillerWidth);
+          bodyFillerWidth = bodyDivWidth - usedWidth;
+          headerFillerWidth = bodyFillerWidth + verticalScrollbarWidth;
           bodyTable.css("width", bodyDivWidth);
         } else {
-          console.log("SET fillerWidth : 0"); // @DEV_ONLY
-          bodyCols.last().attr("width", 0);
-          bodyTable.css("width", usedWidth);
-          var headerFillerWidth = 0;
           if (usedWidth >= (bodyDivWidth - verticalScrollbarWidth)) {
             headerFillerWidth = verticalScrollbarWidth;
           }
-          widths = widths + headerFillerWidth + ",";
-          headerCols.last().attr("width", headerFillerWidth);
+          bodyTable.css("width", usedWidth);
         }
+
+        console.log("SET fillerWidth : " + headerFillerWidth); // @DEV_ONLY
+        widths = widths + headerFillerWidth + ",";
+        bodyCols.last().attr("width", bodyFillerWidth);
+        headerCols.last().attr("width", headerFillerWidth);
+
         // store the width values in a hidden field
         Tobago.Sheet.hidden(sheet, "widths").val(widths);
         return false;